From 417a9362951a78d827e2d6328248d5bcf5254b00 Mon Sep 17 00:00:00 2001 From: Martin Trapp <94928215+martrapp@users.noreply.github.com> Date: Fri, 29 Mar 2024 12:11:20 +0100 Subject: [PATCH] reset history title after push/replace but prior to assignment to location --- packages/astro/src/transitions/router.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/astro/src/transitions/router.ts b/packages/astro/src/transitions/router.ts index c9dd2497ef45..b1d30558beca 100644 --- a/packages/astro/src/transitions/router.ts +++ b/packages/astro/src/transitions/router.ts @@ -184,6 +184,7 @@ const moveToLocation = ( ); } } + document.title = targetPageTitle; // now we are on the new page for non-history navigations! // (with history navigation page change happens before popstate is fired) originalLocation = to; @@ -212,7 +213,6 @@ const moveToLocation = ( } history.scrollRestoration = 'manual'; } - document.title = targetPageTitle; }; function preloadStyleLinks(newDocument: Document) {