Skip to content

Commit 7c7b7c8

Browse files
authored
Merge pull request #431 from oliviervanbulck/master
Fix onLaneScroll not working on different screen sizes #422
2 parents 23f5130 + 4b78739 commit 7c7b7c8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/controllers/Lane.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ class Lane extends Component {
2626
const node = evt.target
2727
const elemScrollPosition = node.scrollHeight - node.scrollTop - node.clientHeight
2828
const {onLaneScroll} = this.props
29-
if (elemScrollPosition <= 0 && onLaneScroll && !this.state.loading) {
29+
// In some browsers and/or screen sizes a decimal rest value between 0 and 1 exists, so it should be checked on < 1 instead of < 0
30+
if (elemScrollPosition < 1 && onLaneScroll && !this.state.loading) {
3031
const {currentPage} = this.state
3132
this.setState({loading: true})
3233
const nextPage = currentPage + 1

0 commit comments

Comments
 (0)