Skip to content

Commit

Permalink
fix restore of scroll state
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan-Kruse committed Jul 26, 2022
1 parent 916347d commit 1a63f0e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Router.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ if (restoreScrollState) {
// If this event was from our history.replaceState, event.state will contain
// our scroll history. Otherwise, event.state will be null (like on forward
// navigation)
if (event.state && event.state.__svelte_spa_router_scrollY) {
if (event.state && (event.state.__svelte_spa_router_scrollY || event.state.__svelte_spa_router_scrollX)) {
previousScrollState = event.state
}
else {
Expand Down

0 comments on commit 1a63f0e

Please sign in to comment.