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
Signed by: hippoz
GPG key ID: 7C52899193467641

View file

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