From bb16919b0a22d2f3f431bb47d2bbf5195f2eda90 Mon Sep 17 00:00:00 2001 From: Lucas Date: Tue, 6 Jun 2023 10:41:58 +0200 Subject: [PATCH 1/2] Fix: Correct the navigation to anchor --- scaladoc/resources/dotty_res/scripts/ux.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scaladoc/resources/dotty_res/scripts/ux.js b/scaladoc/resources/dotty_res/scripts/ux.js index 0ead006af84d..cffb3f41b286 100644 --- a/scaladoc/resources/dotty_res/scripts/ux.js +++ b/scaladoc/resources/dotty_res/scripts/ux.js @@ -285,7 +285,7 @@ document getTocListElement(id).parentElement.classList.toggle("active"); } if (lastEntry.isIntersecting) { - window.location.hash = ""; + history.replaceState(null, "", window.location.pathname + window.location.search); removeAllHighlights(); const id = getIdOfElement(lastEntry); From ee4d697717737353aea898d2f3425be3c8babc7c Mon Sep 17 00:00:00 2001 From: Lucas Date: Fri, 9 Jun 2023 15:04:52 +0200 Subject: [PATCH 2/2] Refactor: Keep the state --- scaladoc/resources/dotty_res/scripts/ux.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scaladoc/resources/dotty_res/scripts/ux.js b/scaladoc/resources/dotty_res/scripts/ux.js index cffb3f41b286..dd6e798f17a5 100644 --- a/scaladoc/resources/dotty_res/scripts/ux.js +++ b/scaladoc/resources/dotty_res/scripts/ux.js @@ -285,7 +285,7 @@ document getTocListElement(id).parentElement.classList.toggle("active"); } if (lastEntry.isIntersecting) { - history.replaceState(null, "", window.location.pathname + window.location.search); + history.replaceState(history.state, "", window.location.pathname + window.location.search); removeAllHighlights(); const id = getIdOfElement(lastEntry);