plentico / plenti

Static Site Generator with Go backend and Svelte frontend

Home Page:https://plenti.co

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Rehydrating jumps to the top

notramo opened this issue · comments

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.

This happened to Gatsby also. Their fix: gatsbyjs/gatsby#11224