Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 4 additions & 12 deletions packages/kit/src/runtime/client/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -3015,18 +3015,10 @@ function reset_focus(url, scroll = null) {
resetting_focus = true;
location.replace(new URL(`#${id}`, location.href));

// if we're using hash routing, we need to restore the original hash after
// setting the focus with `location.replace()`. Although we're calling
// `location.replace()` again, the focus won't shift to the new hash
// unless there's an element with the ID `/current-pathname#hash`, etc.
if (app.hash) {
location.replace(url);
}

// but Firefox has a bug that sets the history state to `null` so we
// need to restore it after.
// See https://bugzilla.mozilla.org/show_bug.cgi?id=1199924
history.replaceState(history_state, '');
// Firefox has a bug that sets the history state to `null` so we need to
// restore it after. See https://bugzilla.mozilla.org/show_bug.cgi?id=1199924
// This is also needed to restore the original hash if we're using hash routing
history.replaceState(history_state, '', url);

// Scroll management has already happened earlier so we need to restore
// the scroll position after setting the sequential focus navigation starting point
Expand Down
Loading