From 1d44d258b541fad32af69f9621aaa453aefc63f6 Mon Sep 17 00:00:00 2001 From: Wick Date: Fri, 25 Jan 2019 18:57:58 +0100 Subject: [PATCH] refactor(smoothscroll, anchoring): use pushState instead of replaceState when updating browser history --- app/dist/scripts/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/dist/scripts/app.js b/app/dist/scripts/app.js index be2b50f..3528f98 100755 --- a/app/dist/scripts/app.js +++ b/app/dist/scripts/app.js @@ -36,7 +36,7 @@ document.querySelectorAll("a[href^='#']").forEach(anchor => { if (document.getElementById(element)) { elementOffset = document.getElementById(element).offsetTop - 74; window.scroll({ top: elementOffset, behavior: "smooth" }); - history.replaceState({}, "", `#${element}`); // Add hash to URL bar + history.pushState({}, "", `#${element}`); // Add hash to URL bar } }); });