Stream.tsx: fix auto-scroll

This commit is contained in:
0x1eef 2022-10-31 13:47:21 -03:00
parent 4dd2d20766
commit 4c0077da57

View file

@ -20,7 +20,7 @@ export function Stream({surah, stream}: StreamProps) {
useEffect(() => { useEffect(() => {
const el: HTMLElement = document.querySelector("ul.stream"); const el: HTMLElement = document.querySelector("ul.stream");
el.scroll({top: el.offsetHeight, behavior: "smooth"}); el.scroll({top: el.offsetHeight * stream.length, behavior: "smooth"});
}, [stream]); }, [stream]);
return ( return (