forked from CringeStudios/gamja
components/scroll-manager: relax scroll check
See https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollHeight#determine_if_an_element_has_been_totally_scrolled
This commit is contained in:
parent
331a2f0c4e
commit
c69869209f
@ -11,7 +11,7 @@ export default class ScrollManager extends Component {
|
||||
|
||||
isAtBottom() {
|
||||
let target = this.props.target.current;
|
||||
return target.scrollTop >= target.scrollHeight - target.offsetHeight;
|
||||
return Math.abs(target.scrollHeight - target.clientHeight - target.scrollTop) <= 10;
|
||||
}
|
||||
|
||||
saveScrollPosition(scrollKey) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user