ItalyPaleAle / svelte-spa-router

Router for SPAs using Svelte 3
MIT License
1.54k stars 105 forks source link

Question about restoreScrollState. #260

Closed nrikiji closed 2 years ago

nrikiji commented 2 years ago

I have embedded the following page as a child element of Router.

The scroll position is not restored on browser back. Is this because the height of the element is not enough when restoring?
Also, I would like to know if there is a way to work around this.

let items = []

onMount(() => {
  // Call web api and set it to items every time
})

<div>
  {#each items as item}
    <div on:click={()=>push("/detail/" + item.id)}>・・・</div>
  {/each}
</div>