We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5413dfc commit c42d2d3Copy full SHA for c42d2d3
src/index.tsx
@@ -5,7 +5,6 @@
5
*
6
*/
7
8
-// @ts-ignore
9
import debounce from 'lodash.debounce'
10
import React, { Component } from 'react'
11
@@ -84,11 +83,10 @@ class BottomScrollListener extends Component<Props> {
84
83
}
85
} else {
86
const scrollNode = document.scrollingElement || document.documentElement
+ const scrollContainerBottomPosition = Math.round(scrollNode.scrollTop + window.innerHeight)
87
+ const scrollPosition = Math.round(scrollNode.scrollHeight - this.props.offset)
88
- if (
89
- scrollNode != null &&
90
- scrollNode.scrollHeight - this.props.offset <= scrollNode.scrollTop + window.innerHeight
91
- ) {
+ if (scrollPosition <= scrollContainerBottomPosition) {
92
this.props.onBottom()
93
94
0 commit comments