sync accepted #2409 fix from upstream
This commit is contained in:
parent
73b6402cff
commit
57af6dd320
1 changed files with 3 additions and 3 deletions
|
@ -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])
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue