diff --git a/src/client/app/router.ts b/src/client/app/router.ts index 6e4f0774..3a7d8cb5 100644 --- a/src/client/app/router.ts +++ b/src/client/app/router.ts @@ -222,11 +222,12 @@ export function createRouter( { capture: true } ) - window.addEventListener('popstate', (e) => { - loadPage( + window.addEventListener('popstate', async (e) => { + await loadPage( normalizeHref(location.href), (e.state && e.state.scrollPosition) || 0 ) + router.onAfterRouteChanged?.(location.href) }) window.addEventListener('hashchange', (e) => {