-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Svelte 5: Element being re-mounted when input transition is changed within an #if block #9932
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
Thanks, I'll take a look when I'm back after the holidays :) |
The transition has been fixed but the action is still re-executed |
What in the modular-ternaries is that example 😅? Could've just used an array. |
@svelte-kit-so-good Not sure I really understand what is going on there, it's a bit hard to follow. |
@trueadm .. eh the comment wasn't really constructive anyway ... just a difference in taste. Does this make it easier to follow?. Edit: oh actually in the example I just gave why does the text inside the {#if} block only update once? |
@svelte-kit-so-good I don't see any issue here? Maybe I'm missing something. How does that work in Svelte 4? |
@trueadm ...oh it looks like if you change 'transition' to 'in' then it's fixed ... unsure if that's a bug: - <p use:log transition:current>
+ <p use:log in:current> Edit: yea it's not svelte5 specific. In both svelte4 and svelte5 the text updates once if using 'transition', otherwise it updates as expected if using 'in' 🤷♀️ |
Describe the bug
If an element inside an #if block has its intro transition changed after being mounted (either with the in: or transition: directive) the intro transition is executed again and the action also runs again (but only the first time the transition changes after the element is mounted)

Reproduction
Reproduction
Logs
No response
System Info
Severity
blocking an upgrade
The text was updated successfully, but these errors were encountered: