From 43564c8b45111c17d67e66de80bf32fd7a7106b5 Mon Sep 17 00:00:00 2001 From: infinite-persistence Date: Mon, 13 Sep 2021 09:58:43 +0800 Subject: [PATCH] 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). --- ui/component/settingsSideNavigation/view.jsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ui/component/settingsSideNavigation/view.jsx b/ui/component/settingsSideNavigation/view.jsx index e791e7ffb..5acb442c6 100644 --- a/ui/component/settingsSideNavigation/view.jsx +++ b/ui/component/settingsSideNavigation/view.jsx @@ -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', + }); } }