Fix auto-scroll in SurahStream.tsx (mobile / iOS)

This commit is contained in:
0x1eef 2023-12-04 00:01:08 -03:00
parent f970cd9895
commit 7d2bdf8a6b

View file

@ -51,8 +51,9 @@ export function Stream({
useEffect(() => {
const ul: HTMLElement = document.querySelector("ul.stream")!;
ul.scroll({ top: ul.scrollHeight, behavior: "smooth" });
}, [stream]);
const top = ul.scrollHeight;
ul.scrollBy({ behavior: "smooth", top });
}, [stream.length]);
return (
<ul lang={locale} className={className} style={style}>