0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-01-27 22:19:04 -05:00

Fix history usage of PR 9563 (#9581)

This commit is contained in:
Martin Trapp 2024-01-02 22:43:09 +01:00 committed by GitHub
parent d48ab90fb4
commit 98c69b89cc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -215,7 +215,7 @@ const moveToLocation = (to: URL, from: URL, options: Options, historyState?: Sta
history.scrollRestoration = 'auto';
const savedState = history.state;
location.href = to.href; // this kills the history state on Firefox
history.state || history.replaceState(savedState, ''); // this restores the history state
history.state || replaceState(savedState, ''); // this restores the history state
} else {
if (!scrolledToTop) {
scrollTo({ left: 0, top: 0, behavior: 'instant' });