mirror of
https://github.com/tiddly-gittly/TidGi-Desktop.git
synced 2025-12-05 18:20:39 -08:00
fix: scroll will stop halfway.
This commit is contained in:
parent
4724020772
commit
694cf46d49
1 changed files with 4 additions and 1 deletions
|
|
@ -43,7 +43,10 @@ export default function Preferences(): JSX.Element {
|
|||
useEffect(() => {
|
||||
const scrollTo = (window.meta() as IPossibleWindowMeta<WindowMeta[WindowNames.preferences]>).preferenceGotoTab;
|
||||
if (scrollTo === undefined) return;
|
||||
setTimeout(() => {
|
||||
// wait 100ms so page anchors are all loaded. Otherwise scroll will stop halfway.
|
||||
sections[scrollTo].ref?.current?.scrollIntoView({ behavior: 'smooth', block: 'start' });
|
||||
}, 100);
|
||||
}, [sections]);
|
||||
|
||||
return (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue