Fix auto-scroll in SurahStream.tsx (mobile / iOS)
This commit is contained in:
parent
98cf4f5234
commit
454faac829
1 changed files with 3 additions and 2 deletions
|
@ -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}>
|
||||
|
|
Loading…
Reference in a new issue