From 1a63f0e2c74115cc0808cd7676655f533aaf1125 Mon Sep 17 00:00:00 2001 From: Jan Kruse Date: Tue, 26 Jul 2022 18:28:50 +0200 Subject: [PATCH] fix restore of scroll state --- Router.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Router.svelte b/Router.svelte index ece9f4d..f595346 100644 --- a/Router.svelte +++ b/Router.svelte @@ -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 {