svelte
svelte copied to clipboard
Svelte 5: Adding a delay param to svelte transitions causes the node to immediately appear for the duration of the delay
Describe the bug
Adding a delay param to svelte transitions in svelte 5 causes the node to immediately appear for the duration of the delay. After this period the node disappears and starts its transition. Removing the delay param fixes this issue.
Reproduction
https://svelte-5-preview.vercel.app/#H4sIAAAAAAAAE6VQzUrEMBB-ldmodBciba8xLXjzAbxZD7Gd0GCalGSqlpB3l-winhTEywwz8_0xiWljMTLxlJhTCzLB7teVcUb7Wob4hpaQcRb9FsaykXEMZqV-cAOZZfWBIIFWE3LQducQR2URMujgF6gu_JqCctGQ8a66K0SLBHH279DBdSRFeNTKRjyVo5P1t4WTLxuRd-DdaM342qXjqeu_uIfSc1-qrC_AfnDpyugzIhcrObdgnCgJu5QmtGoX0DZNw2HagiqZLnPO_QNa6-FxxoAHWc9tEauNzj9p2v13SQ4fAqrbtrmp_q5-fuQ_Ig-Ocbb4yWiDExMUNszP-RPaLwNI8QEAAA==
Logs
No response
System Info
Browser: Chrome Version 123.0.6312.122 (Official Build) (arm64), m1 mac
Locally: "svelte": "5.0.0-next.110"
Severity
blocking an upgrade
Quickly chiming in here as it was related to the https://github.com/sveltejs/svelte/pull/11216 fix
At first sight, changing fill: 'forwards'
to fill: 'both'
fixes this issue, although as stated in my comment it creates unexpected behavior but this time it's "stacked".
While testing delayed WAAPI animate() with fill: 'both'
in my nested transition-heavy tree, clicking an expandable item multiple times would result in a stacked animation to be applied. Previous animation isn't aborted so it ends up as if we simply executed the call animate({delay:1000,...})
multiple times.
Broken from alpha 82; working in alpha 81 (stackblitz demo).
Basically the same as #10876
Adding my flip repro to this as it affects flip
too.
Any delay at all causes the items to jarringly appear in their new locations until the delay is over before snapping back just as the animation starts.
This should have been fixed by #12389 , can you test if now is working properly?
Fixed by #12389