Skip to content

Commit 3234b6a

Browse files
committed
Fix the logic error when use body as scroll element #16
1 parent d812e2b commit 3234b6a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/components/InfiniteLoading.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
* @return {Number} distance
4141
*/
4242
function getCurrentDistance(elm) {
43-
const styles = getComputedStyle(elm);
43+
const styles = getComputedStyle(elm === window ? document.body : elm);
4444
const innerHeight = elm === window
4545
? window.innerHeight
4646
: parseInt(styles.height, 10);

0 commit comments

Comments
 (0)