DEV Community

Discussion on: Simple Page Transitions with SvelteKit

Collapse
 
glassforms profile image
Robert Stewart

Have you ever tried this approach using a fixed navigation? In all of the demos I've seen, when you click on a link, the site jumps you to the top of the page before transitioning the page out. Do you know why this happens, and how to prevent it?

Collapse
 
tomaaron profile image
Tom Koch

I'm having the same issue with bulma and fixed navbar. The only way to mitigate is to remove the out transition.

Collapse
 
evanwinter profile image
Evan Winter

I am seeing this too. Not sure how to fix at the moment.

I'm guessing it's because there's a moment mid-transition where the previous page content is unmounted and the new page content hasn't yet mounted, resulting in a document height that doesn't exceed the window height.

I know Gatsby and NextJS have solutions for persisting scroll position; I wonder if there's something like that out there for SvelteKit?