Skip to content

Commit

Permalink
Merge pull request #268 from Jan-Kruse/fix-restore-scroll-state
Browse files Browse the repository at this point in the history
Fix restore of scroll state
  • Loading branch information
ItalyPaleAle authored Aug 7, 2022
2 parents 916347d + 1a63f0e commit e076e76
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 e076e76

Please sign in to comment.