Skip to content

Fix onLaneScroll not working on different screen sizes #422 #431

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 10, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/controllers/Lane.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ class Lane extends Component {
const node = evt.target
const elemScrollPosition = node.scrollHeight - node.scrollTop - node.clientHeight
const {onLaneScroll} = this.props
if (elemScrollPosition <= 0 && onLaneScroll && !this.state.loading) {
// 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
if (elemScrollPosition < 1 && onLaneScroll && !this.state.loading) {
const {currentPage} = this.state
this.setState({loading: true})
const nextPage = currentPage + 1
Expand Down