-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Transition not removing extra DOM nodes after completion #7119
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
This issue might be what's causing #1591 |
A possible cause of this issue is an active transition belonging to a child component, in this case applying the https://svelte.dev/tutorial/local-transitions |
Bumping this with another repro for what looks like the same underlying issue: When having an If Block with an Each block inside it that creates a component, like {#if active.length > 0}
<div transition:fly={{ x: -10, duration: 1000 }}>
{#each active as mod}
<Mod mod={mod}/>
{/each}
</div>
{/if} Changing the The same code seems to work correctly in the Svelte5 playground. The behavior also does not occour if the content of the each block is a normal Element instead of a Svelte component. Help thread on the Svelte Discord about this can be found here
|
Fixed in Svelte 5 |
Describe the bug
When you have an element with a transition and destroy it, but then recreate it before the transition is done, you can end up with old elements not being removed.
Reproduction
REPL
When you type in the input field, the
value
is set to what you typed if thevalue
is empty, otherwise thevalue
is cleared. Try randomly spamming your keyboard, and a bunch of extra elements should be left there.Logs
No response
System Info
System: OS: macOS 10.15.7 CPU: (8) x64 Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz Memory: 1.35 GB / 32.00 GB Shell: 3.2.2 - /usr/local/bin/fish Binaries: Node: 16.13.1 - /var/folders/gs/3qcm1mc918s08sxvkj6zj2rr0000gp/T/fnm_multishells/87890_1641758181492/bin/node Yarn: 1.22.17 - /var/folders/gs/3qcm1mc918s08sxvkj6zj2rr0000gp/T/fnm_multishells/87890_1641758181492/bin/yarn npm: 8.1.2 - /var/folders/gs/3qcm1mc918s08sxvkj6zj2rr0000gp/T/fnm_multishells/87890_1641758181492/bin/npm Browsers: Brave Browser: 96.1.32.106 Chrome: 96.0.4664.110 Firefox: 95.0.2 Safari: 15.2 npmPackages: svelte: ^3.45.0 => 3.45.0
Severity
annoyance
The text was updated successfully, but these errors were encountered: