We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fe8bede commit 63900feCopy full SHA for 63900fe
lib/index.js
@@ -18,7 +18,9 @@ class BottomScrollListener extends Component {
18
}
19
20
handleOnScroll() {
21
- if (document.body.scrollHeight - this.props.offset <= (document.body.scrollTop + window.innerHeight)) {
+ const scrollNode = document.scrollingElement || document.documentElement;
22
+
23
+ if (scrollNode.scrollHeight - this.props.offset <= (scrollNode.scrollTop + window.innerHeight)) {
24
this.props.onBottom();
25
26
package.json
@@ -1,6 +1,6 @@
1
{
2
"name": "react-bottom-scroll-listener",
3
- "version": "1.0.3",
+ "version": "1.1.0",
4
"description": "A simple React component that lets you listen for when you have scrolled to the bottom.",
5
"main": "dist/react-bottom-scroll-listener.js",
6
"scripts": {
0 commit comments