From: Ardis Lu Date: Fri, 11 Aug 2023 04:30:48 +0000 (-0700) Subject: Fix bug where in-memory pages are served midscroll X-Git-Url: https://git.ardis.lu/?a=commitdiff_plain;h=0f2960e2f4ee665238619aae77ca71e1ead8354e;p=ardislu.dev Fix bug where in-memory pages are served midscroll --- diff --git a/script.js b/script.js index b52754e..ef88dec 100644 --- a/script.js +++ b/script.js @@ -302,6 +302,9 @@ function route(href) { else { history.pushState({}, '', url); showPage(url.pathname); + // Reset scroll to simulate new page load when an in-memory page is served + // This does not affect the back/forward button + scroll(0, 0); } }