Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transitions not working properly in Svelte 5. #11615

Open
DanniScript opened this issue May 14, 2024 · 2 comments
Open

Transitions not working properly in Svelte 5. #11615

DanniScript opened this issue May 14, 2024 · 2 comments
Milestone

Comments

@DanniScript
Copy link

DanniScript commented May 14, 2024

Describe the bug

I have a menu for navigating between pages. Inside each page, I have a transition. In Svelte 4, this is okay and working, but in Svelte 5, it doesn't work.

If we use the {#key $page.url.pathname } block as a solution in Svelte 4 works as expected, but if we navigate between subpath (navigating between settings in the example) in Svelte 5 looks like the animations runs globally. I tried to avoid this using transition:fly|local={ ... } but no difference.

Reproduction

Svelte 4 transitions (working): https://stackblitz.com/edit/stackblitz-starters-k3emwx
Svelte 5 transitions (not working): https://stackblitz.com/edit/stackblitz-starters-tzwvvo

Using {#key $page.url.pathname }
Svelte 4: https://stackblitz.com/edit/stackblitz-starters-ohxp9w
Svelte 5: https://stackblitz.com/edit/stackblitz-starters-331yde

Logs

No response

System Info

Yes

Severity

annoyance

@henriquekirchheck
Copy link

I experienced a similar problem, I recreated it in a simpler way to demonstrate:

Svelte 5 Preview Website

@trueadm trueadm added this to the 5.0 milestone May 15, 2024
@kinglouie
Copy link

I'll link this here sveltejs/kit#11104 because I hope page transitions will get better support in svelte 5, the key approach unfortunately always has some timing issues, even in svelte 4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants