Settings: use 'smooth' instead of 'instant' scroll.
With 'instant', it is not clear that we are actually scrolling within the existing page (not opening a new page).
This commit is contained in:
parent
bbcdcfe4c1
commit
43564c8b45
1 changed files with 5 additions and 1 deletions
|
@ -56,7 +56,11 @@ export default function SettingsSideNavigation() {
|
|||
const TOP_MARGIN_PX = 20;
|
||||
const element = document.getElementById(section);
|
||||
if (element) {
|
||||
window.scrollTo(0, element.offsetTop - TOP_MARGIN_PX);
|
||||
window.scrollTo({
|
||||
top: element.offsetTop - TOP_MARGIN_PX,
|
||||
left: 0,
|
||||
behavior: 'smooth',
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue