scrollBy offsetHeight + scrollTop

This commit is contained in:
0x1eef 2023-12-04 00:14:35 -03:00
parent 23c9757fd0
commit e0ed29b812

View file

@ -51,7 +51,7 @@ export function Stream({
useEffect(() => { useEffect(() => {
const ul: HTMLElement = document.querySelector("ul.stream")!; const ul: HTMLElement = document.querySelector("ul.stream")!;
const top = ul.scrollHeight; const top = ul.offsetHeight + ul.scrollTop;
ul.scrollBy({ behavior: "smooth", top }); ul.scrollBy({ behavior: "smooth", top });
}, [stream.length]); }, [stream.length]);