We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2a6b7fd commit 6972308Copy full SHA for 6972308
src/lib/core/LocationLite.svelte.ts
@@ -44,6 +44,10 @@ export class LocationLite implements Location {
44
['popstate', 'hashchange'].forEach((event) => {
45
cleanups.push(on(globalThis.window, event, () => {
46
this.#innerState.url.href = globalThis.window?.location?.href;
47
+ if (!globalThis.window?.history?.state) {
48
+ // Potential <a> hash navigation. Preserve current state.
49
+ this.#goTo(this.#innerState.url.href, true, this.#innerState.state);
50
+ }
51
this.#innerState.state = globalThis.window?.history?.state ?? this.#innerState.state;
52
}));
53
});
0 commit comments