From 332311234a0aa2974b2450710e22e09d90dd6b0b Mon Sep 17 00:00:00 2001 From: Jonas Wunderlich <32615971+jonas-w@users.noreply.github.com> Date: Fri, 4 Aug 2023 20:16:11 +0000 Subject: fix firefox autoscroll (#2519) --- examples/server/public/index.html | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'examples/server/public/index.html') diff --git a/examples/server/public/index.html b/examples/server/public/index.html index 1db69a6..de41da1 100644 --- a/examples/server/public/index.html +++ b/examples/server/public/index.html @@ -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]) -- cgit v1.2.3