fix firefox autoscroll

This commit is contained in:
Jonas Wunderlich 2023-08-04 21:54:43 +02:00
parent 182af739c4
commit dff68fd968
No known key found for this signature in database
GPG key ID: 24CBC4B3DBFAAB90
2 changed files with 556 additions and 556 deletions

File diff suppressed because it is too large Load diff

View file

@ -282,8 +282,9 @@
useEffect(() => {
// scroll to bottom (if needed)
if (container.current && container.current.scrollHeight <= container.current.scrollTop + container.current.offsetHeight + 300) {
container.current.scrollTo(0, container.current.scrollHeight)
const parent = container.current.parentElement;
if (parent && parent.scrollHeight <= parent.scrollTop + parent.offsetHeight + 300) {
parent.scrollTo(0, parent.scrollHeight)
}
}, [messages])