Update index.html
This commit is contained in:
parent
1a941869cb
commit
01bdda2574
1 changed files with 2 additions and 2 deletions
|
@ -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])
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue