Skip to content

Commit

Permalink
fix: fixed behaviour of subsections accordion
Browse files Browse the repository at this point in the history
  • Loading branch information
giuliano176 committed Mar 15, 2022
1 parent e0549a1 commit fdffddf
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/settings/components/settings-header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,15 @@ const SettingsHeader: FC<SettingsHeaderProps> = ({ onSave, onCancel, isDirty, ti
];
const search = history.location?.search;
useEffect(() => {
setTimeout(
() =>
document
.querySelector(`#${history.location.search}`.replace('?section=', ''))
?.scrollIntoView(),
1
);
if (search) {
setTimeout(
() =>
document
.querySelector(`#${history.location.search}`.replace('?section=', ''))
?.scrollIntoView(),
1
);
}
}, [history, history.location, history.location.search, search, useparam]);
return (
<>
Expand Down

0 comments on commit fdffddf

Please sign in to comment.