user a different method of detecting scroll, hopefully fixing ios webkit scroll

This commit is contained in:
hippoz 2022-09-02 19:13:10 +03:00
parent 476a36b79a
commit 81e9de6cd8
No known key found for this signature in database
GPG key ID: 7C52899193467641

View file

@ -25,8 +25,8 @@
});
const onScroll = (e) => {
const { scrollTop, offsetHeight, scrollHeight } = e.target;
if ((scrollTop + offsetHeight) >= (scrollHeight - 10)) { // user scrolled to bottom
const { scrollHeight, scrollTop, clientHeight } = e.target;
if ((scrollHeight - scrollTop - clientHeight) <= 20) { // user scrolled to bottom
messages.setIsCollectingOldMessages(true);
shouldAutoscroll = true;
isScrolledToBottom = true;