Update index.html

This commit is contained in:
JackJollimore 2023-07-27 11:35:17 -03:00 committed by GitHub
parent 1a941869cb
commit 01bdda2574
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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