diff --git a/packages/frontend/src/client/spa/client.js b/packages/frontend/src/client/spa/client.js index fc702045..704dfbdf 100644 --- a/packages/frontend/src/client/spa/client.js +++ b/packages/frontend/src/client/spa/client.js @@ -8,8 +8,6 @@ const headers = { Accept: APPLICATION_JSON, }; -history.scrollRestoration = "manual"; - const scroll = (x, y) => global.scrollTo(x, y); const scroll_hash = hash => { if (hash === "") { @@ -93,6 +91,13 @@ const go = async (href, updater, event) => { }; export default updater => { + global.addEventListener("load", _ => { + history.scrollRestoration = "manual"; + if (global.location.hash !== "") { + scroll_hash(global.location.hash); + } + }); + global.addEventListener("beforeunload", _ => { history.scrollRestoration = "auto"; });