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

This commit is contained in:
0x1eef 2023-12-04 00:01:08 -03:00
parent 98cf4f5234
commit 454faac829

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}>