mirror of
https://github.com/withastro/astro.git
synced 2025-03-31 23:31:30 -05:00
reset history title after push/replace but prior to assignment to location (#10605)
* reset history title after push/replace but prior to assignment to location * add changeset
This commit is contained in:
parent
e648c5575a
commit
a16a829f4e
2 changed files with 6 additions and 1 deletions
5
.changeset/eighty-olives-destroy.md
Normal file
5
.changeset/eighty-olives-destroy.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
"astro": patch
|
||||
---
|
||||
|
||||
Fixes an issue with outdated page titles in browser history when using text fragments in view transition navigation.
|
|
@ -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) {
|
||||
|
|
Loading…
Add table
Reference in a new issue