Skip to content

Commit a30ccba

Browse files
nitkukankeetmaini
authored andcommitted
Changes logic to determine element at bottom or not (#55)
1 parent 2bd0406 commit a30ccba

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

app/index.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,7 @@ export default class InfiniteScroll extends Component {
139139
const clientHeight = (target === document.body || target === document.documentElement)
140140
? window.screen.availHeight : target.clientHeight;
141141

142-
const scrolled = scrollThreshold * (target.scrollHeight - target.scrollTop);
143-
return scrolled <= clientHeight;
142+
return (target.scrollTop + clientHeight) >= scrollThreshold * target.scrollHeight;
144143
}
145144

146145
onScrollListener (event) {

0 commit comments

Comments
 (0)