@@ -55,7 +55,7 @@ import config, {
55
55
evt3rdArg , WARNINGS , STATUS , SLOT_STYLES ,
56
56
} from ' ../config' ;
57
57
import {
58
- warn , throttleer , loopTracker , scrollBarStorage , kebabCase ,
58
+ warn , throttleer , loopTracker , scrollBarStorage , kebabCase , isVisible ,
59
59
} from ' ../utils' ;
60
60
61
61
export default {
@@ -125,7 +125,7 @@ export default {
125
125
spinner: String ,
126
126
direction: {
127
127
type: String ,
128
- default: config . props . direction ,
128
+ default: ' bottom ' ,
129
129
},
130
130
forceUseInfiniteWrapper: {
131
131
type: [Boolean , String ],
@@ -148,7 +148,7 @@ export default {
148
148
149
149
this .scrollHandler = function scrollHandlerOriginal (ev ) {
150
150
if (this .status === STATUS .READY ) {
151
- if (ev && ev .constructor === Event ) {
151
+ if (ev && ev .constructor === Event && isVisible ( this . $el ) ) {
152
152
throttleer .throttle (this .attemptLoad );
153
153
} else {
154
154
this .attemptLoad ();
@@ -254,12 +254,10 @@ export default {
254
254
* event handler
255
255
*/
256
256
attemptLoad (isContinuousCall ) {
257
- const currentDistance = this .getCurrentDistance ();
258
-
259
257
if (
260
258
this .status !== STATUS .COMPLETE
261
- && currentDistance <= this .distance
262
- && ( this .$el . offsetWidth + this .$el . offsetHeight ) > 0
259
+ && isVisible ( this .$el )
260
+ && this .getCurrentDistance () <= this .distance
263
261
) {
264
262
this .status = STATUS .LOADING ;
265
263
0 commit comments