-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Key block with transition breaks client side routing #5321
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
Comments
Did you try |
thanks, local does fix the issue. do you know why local fixes this here and what the underlying issue is? hopefully we can still consider the above is a bug to be fixed. even if it's listening for parent mount/unmount (i.e. the route pages index and test in this case) i think it shouldn't break to this degree :/ |
We have a similar issue with route changes stacking the incoming page content at the bottom instead of swapping it, but we're not using transitions anywhere. It's hard to reproduce, and I haven't figured out anything that seems to trigger it, other than randomly clicking around between pages. |
Experiencing this issue with the latest update as well, transitions in key blocks have their content briefly duplicated on insert. |
This is just the reality of how Svelte transitions work: outroing content remains in the DOM until the transition is complete. It's not specific to routing. To avoid duplicating content, you have to be careful to only apply transitions to elements that aren't in the document flow (thing The I'm going to close this as there's nothing SvelteKit could really be doing differently here. Rethinking transitions is on the roadmap for Svelte 4 though. |
+1 |
Describe the bug
Using a key block with transitions (e.g. fade) will break client side routing, producing non-deterministic artifacting, including: route contents being displayed together (stacked on top of each other) and ghost key blocks (i.e. the starting, invisible versions of the fades)
I am guessing this happens because we are swapping routes mid-key-block-transition, and the client side routing conflicts with whatever code is running key block transitions?
CleanShot.2022-06-29.at.18.15.04.mp4
The effect gets worse as you have more key blocks
CleanShot.2022-06-29.at.18.12.42.mp4
I ran into this while making a feed of auto-advancing carousels which used the key block technique to crossfade between images in each feed item.
Reproduction
https://github.com/tarngerine/key-block-bug
{#key value}
block with atransition:fade
on the immediate childExpected:
Actual:
Logs
No response
System Info
Severity
serious, but I can work around it
Additional Information
No response
The text was updated successfully, but these errors were encountered: