Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ccff4ce

Browse files
committed
refactor: fix number determine logic
1 parent 95f7e59 commit ccff4ce

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
@@ -273,9 +273,9 @@ export default {
273273
let distance;
274274
275275
if (this.direction === 'top') {
276-
distance = Number.isNaN(this.scrollParent.scrollTop)
277-
? this.scrollParent.pageYOffset
278-
: this.scrollParent.scrollTop;
276+
distance = typeof this.scrollParent.scrollTop === 'number'
277+
? this.scrollParent.scrollTop
278+
: this.scrollParent.pageYOffset;
279279
} else {
280280
const infiniteElmOffsetTopFromBottom = this.$el.getBoundingClientRect().top;
281281
const scrollElmOffsetTopFromBottom = this.scrollParent === window

0 commit comments

Comments
 (0)