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

Outro transition gets interrupted when mutating array #13302

Closed
0Abdullah opened this issue Sep 18, 2024 · 3 comments · Fixed by #13379 or #13527
Closed

Outro transition gets interrupted when mutating array #13302

0Abdullah opened this issue Sep 18, 2024 · 3 comments · Fixed by #13379 or #13527
Assignees
Milestone

Comments

@0Abdullah
Copy link

0Abdullah commented Sep 18, 2024

Describe the bug

mutating an array in Svelte 5 causes the outro animation to end abruptly and the element to be removed immediately from the DOM.

in Svelte 4 it works correctly: REPL

Reproduction

https://svelte-5-preview.vercel.app/#H4sIAAAAAAAACm1RwWrdMBD8lUUtxA7m-eXQi-v3oJfcQkKaW5yDaq1jUVky0iptEPr3ohVt09CLjWZnZmd3k1i0wSCGxySs3FAM4su-i07Q614e4QUNoehEcNHPBRnD7PVO58lO1F9C-U30lWnwCW4jwYOXNmjSzsI97t6pOJfHoVIf_CvsMazaPoOEBX-AJtwCSKuAVrTgcXMvXLVc6ipcNL8htrrsy1dvu_MECRapEDIs3m1wUWP39CfJxWfubicySGB0IDjBx0CSsHl8akvVTrREy1G5WdNCqpEL_cBQAq0GuJG0Hry0ym1N2wHhTxrY82DQPtMKuS3C_M6UB8Nr7QO98w670TM2xw6uOEqRjv3fRdvxWyRyFpydjZ6_n1JJk_kGd2Uv6U131lb--T_KNymqwT0DwAhv9x_9ZMdomJc-oJzXujsZmAkNX0OrNtdpRqPBRRrKMU4pgYpeltkHuDoej5DzObGirCyPvdHVuS_OnDuas-jE5pReNCoxkI-Yn_Ivj4K48acCAAA=

Logs

No response

System Info

irrelevant

Severity

annoyance

@trueadm trueadm added the bug label Sep 19, 2024
@dummdidumm dummdidumm added this to the 5.0 milestone Sep 19, 2024
@garikAsplund
Copy link

Has this been solved? When I try it in each of the provided links I can't spot a difference. Or maybe I'm doing it wrong? I'm just clicking the buttons to manipulate the array, but keep getting the expected behavior with transitions.

@trueadm
Copy link
Contributor

trueadm commented Sep 24, 2024

So digging into this more, the issue is:

https://github.com/sveltejs/svelte/blob/main/packages/svelte/src/internal/client/reactivity/effects.js#L485-L486

When we remove the first item, that row because inert. When we add a new row we reconcile again, but the first item is still flagged for removal again, so we try to pause it again. However, as it's now inert, we don't add it to the transition array and just wipe it instantly without waiting for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment