File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -75,11 +75,13 @@ class BottomScrollListener extends Component<Props> {
75
75
if ( this . props . children instanceof Function ) {
76
76
const scrollNode = this . optionalScrollContainerRef . current
77
77
78
- if (
79
- scrollNode != null &&
80
- scrollNode . scrollHeight - this . props . offset <= scrollNode . scrollTop + scrollNode . clientHeight
81
- ) {
82
- this . props . onBottom ( )
78
+ if ( scrollNode != null ) {
79
+ const scrollContainerBottomPosition = Math . round ( scrollNode . scrollTop + scrollNode . clientHeight )
80
+ const scrollPosition = Math . round ( scrollNode . scrollHeight - this . props . offset )
81
+
82
+ if ( scrollPosition <= scrollContainerBottomPosition ) {
83
+ this . props . onBottom ( )
84
+ }
83
85
}
84
86
} else {
85
87
const scrollNode = document . scrollingElement || document . documentElement
You can’t perform that action at this time.
0 commit comments