diff --git a/gatsby-browser.js b/gatsby-browser.js index a6195c7657a..feb9f696645 100644 --- a/gatsby-browser.js +++ b/gatsby-browser.js @@ -17,22 +17,5 @@ function scrollToAnchor(location, mainNavHeight = 0) { const toc = document.querySelector(".toc-sticky .active"); if (toc) toc.scrollIntoView({ block: "nearest" }); - // Check for location so build does not fail - if (location && location.hash) { - try { - const item = document.getElementById(location.hash.substring(1)); - - if (item) { - window.scrollTo({ - top: item.offsetTop - mainNavHeight, - behavior: "smooth", - }); - } - } catch (error) { - // if hash is bad exception will be raised - console.error(error); - } - } - return true; } diff --git a/src/styles/_helpers.scss b/src/styles/_helpers.scss index 1ae1243f461..160ad81d649 100644 --- a/src/styles/_helpers.scss +++ b/src/styles/_helpers.scss @@ -123,8 +123,12 @@ svg { .arrow-list { list-style-type: "→"; } -html { - scroll-behavior: smooth; + + +// force-disable this - it causes annoying jumps when navigating, and a bug w/ anchor links in Firefox +$enable-smooth-scroll: false; +:root { + scroll-behavior: auto !important; } /* fill colors */