diff --git a/app/components/Sidebar/components/NavLink.tsx b/app/components/Sidebar/components/NavLink.tsx index ab15f98ac..afb438d6e 100644 --- a/app/components/Sidebar/components/NavLink.tsx +++ b/app/components/Sidebar/components/NavLink.tsx @@ -94,12 +94,9 @@ const NavLink = ({ React.useLayoutEffect(() => { if (isActive && linkRef.current && scrollIntoViewIfNeeded !== false) { // If the page has an anchor hash then this means we're linking to an - // anchor in the document generally – smooth scrolling the sidebar may - // interrupt the scrolling to the anchor of the document so we jump - // directly to the anchor instead. - if (window.location.hash) { - linkRef.current.scrollIntoView(); - } else { + // anchor in the document – smooth scrolling the sidebar may the scrolling + // to the anchor of the document so we must avoid it. + if (!window.location.hash) { scrollIntoView(linkRef.current, { scrollMode: "if-needed", behavior: "auto",