@@ -122,7 +122,7 @@ class ScrollScreenClass {
122
122
return dom && document . defaultView && document . defaultView . getComputedStyle ?
123
123
document . defaultView . getComputedStyle ( dom ) : { } ;
124
124
}
125
- isScroll = ( dom ) => {
125
+ isScroll = ( dom , deltaY ) => {
126
126
const style = this . getComputedStyle ( dom ) ;
127
127
const overflow = style . overflow ;
128
128
const overflowY = style . overflowY ;
@@ -131,12 +131,15 @@ class ScrollScreenClass {
131
131
// dom.parentNode === document 解决在滚动条上滚动取不到 body;
132
132
if ( dom === document . body || ! dom || dom . parentNode === document ) {
133
133
return false ;
134
- } else if ( dom . scrollHeight > dom . offsetHeight
135
- && isScrollOverflow
136
- && dom . scrollTop < dom . scrollHeight ) {
134
+ } else if (
135
+ dom . scrollHeight > dom . offsetHeight &&
136
+ isScrollOverflow &&
137
+ dom . scrollTop + dom . offsetHeight + deltaY < dom . scrollHeight &&
138
+ dom . scrollTop + deltaY > 0
139
+ ) {
137
140
return true ;
138
141
}
139
- return this . isScroll ( dom . parentNode ) ;
142
+ return this . isScroll ( dom . parentNode , deltaY ) ;
140
143
}
141
144
limitNum = ( min , max ) => {
142
145
if ( this . vars . loop ) {
@@ -148,11 +151,12 @@ class ScrollScreenClass {
148
151
}
149
152
}
150
153
onWheel = ( e ) => {
151
- e . preventDefault ( ) ;
152
- if ( this . isScroll ( e . target ) ) {
154
+ const deltaY = e . deltaY ;
155
+ if ( this . isScroll ( e . target , deltaY ) ) {
153
156
return ;
154
157
}
155
- const deltaY = e . deltaY ;
158
+ e . preventDefault ( ) ;
159
+
156
160
const mapped = this . mapped ;
157
161
if ( this . rafID === - 1 && deltaY !== 0 && this . toHeight === - 1 ) {
158
162
const winHeight = windowHeight ( ) ;
0 commit comments