File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,9 @@ class BottomScrollListener extends Component {
18
18
}
19
19
20
20
handleOnScroll ( ) {
21
- if ( document . body . scrollHeight - this . props . offset <= ( document . body . scrollTop + window . innerHeight ) ) {
21
+ const scrollNode = document . scrollingElement || document . documentElement ;
22
+
23
+ if ( scrollNode . scrollHeight - this . props . offset <= ( scrollNode . scrollTop + window . innerHeight ) ) {
22
24
this . props . onBottom ( ) ;
23
25
}
24
26
}
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " react-bottom-scroll-listener" ,
3
- "version" : " 1.0.3 " ,
3
+ "version" : " 1.1.0 " ,
4
4
"description" : " A simple React component that lets you listen for when you have scrolled to the bottom." ,
5
5
"main" : " dist/react-bottom-scroll-listener.js" ,
6
6
"scripts" : {
You can’t perform that action at this time.
0 commit comments