Skip to content

Commit 8b47b2d

Browse files
committed
Fix the scroll wrapper search bug if the wrapper element is body #100
1 parent 2f2a235 commit 8b47b2d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/components/InfiniteLoading.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -263,12 +263,12 @@
263263
getScrollParent(elm = this.$el) {
264264
let result;
265265
266-
if (elm.tagName === 'BODY') {
267-
result = window;
268-
} else if (!this.forceUseInfiniteWrapper && ['scroll', 'auto'].indexOf(getComputedStyle(elm).overflowY) > -1) {
266+
if (!this.forceUseInfiniteWrapper && ['scroll', 'auto'].indexOf(getComputedStyle(elm).overflowY) > -1) {
269267
result = elm;
270268
} else if (elm.hasAttribute('infinite-wrapper') || elm.hasAttribute('data-infinite-wrapper')) {
271269
result = elm;
270+
} else if (elm.tagName === 'BODY') {
271+
result = window;
272272
}
273273
274274
return result || this.getScrollParent(elm.parentNode);

0 commit comments

Comments
 (0)