Rehydrating jumps to the top
notramo opened this issue · comments
notramo commented
If the user scrolls the pre-rendered page while the Svelte components are still loading, the document jumps to the top when the loading is finished, and the pre-rendered document is swapped with the Svelte version.
One possible solution I can think of is to save the position before swapping, and use window.scrollTo()
immediately after hydrating is finished.
notramo commented
This happened to Gatsby also. Their fix: gatsbyjs/gatsby#11224