sync accepted #2409 fix from upstream

This commit is contained in:
staviq 2023-08-16 23:19:55 +02:00
parent 73b6402cff
commit 57af6dd320

View file

@ -414,9 +414,9 @@
useEffect(() => { useEffect(() => {
// scroll to bottom (if needed) // scroll to bottom (if needed)
let scrollable = document.querySelector('#content'); const parent = container.current.parentElement;
if (scrollable && scrollable.scrollHeight <= scrollable.scrollTop + scrollable.offsetHeight + 300) { if (parent && parent.scrollHeight <= parent.scrollTop + parent.offsetHeight + 300) {
scrollable.scrollTo(0, scrollable.scrollHeight) parent.scrollTo(0, parent.scrollHeight)
} }
}, [messages]) }, [messages])