Skip to content

Commit b4cf822

Browse files
committed
forgot to restore scroll pos
1 parent 3008146 commit b4cf822

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

packages/kit/src/runtime/client/client.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2529,22 +2529,22 @@ function reset_focus() {
25292529
} else {
25302530
// Reset page selection and focus
25312531
if (location.hash && document.querySelector(location.hash)) {
2532-
// scroll management has already happened earlier so we need to make sure
2533-
// the scroll position stays the same after setting the sequential focus navigation starting point
25342532
const { x, y } = scroll_state();
25352533

25362534
setTimeout(() => {
25372535
const history_state = history.state;
25382536
// Mimic the browsers' behaviour and set the sequential focus navigation
2539-
// starting point to the fragment identifier...
2537+
// starting point to the fragment identifier
25402538
location.replace(location.hash);
2541-
// ...but Firefox has a bug that sets the history state as null so we
2539+
// but Firefox has a bug that sets the history state as null so we
25422540
// need to restore the history state
2543-
// see https://bugzilla.mozilla.org/show_bug.cgi?id=1199924
2541+
// See https://bugzilla.mozilla.org/show_bug.cgi?id=1199924
25442542
history.replaceState(history_state, '', location.hash);
2545-
});
25462543

2547-
scrollTo(x, y);
2544+
// Scroll management has already happened earlier so we need to restore
2545+
// the scroll position after setting the sequential focus navigation starting point
2546+
scrollTo(x, y);
2547+
});
25482548
} else {
25492549
// We try to mimic browsers' behaviour as closely as possible by targeting the
25502550
// first scrollable region, but unfortunately it's not a perfect match — e.g.

0 commit comments

Comments
 (0)