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

Svelte5: Transitions break when state changes while it is still running. DOM does not reflect state properly. #11528

Open
Alia5 opened this issue May 9, 2024 · 0 comments

Comments

@Alia5
Copy link

Alia5 commented May 9, 2024

Describe the bug

If you have a transition on an element and the condition changes while the transition is still running,
then only the first state change triggers the transition, subsequent state changes are not triggering new transitions,
nor cancel the already running one.

This is especially bad if one is using forms with use:enhance in SvelteKit, as form-ActionData gets set to undefined on submit and applied afterward.
If the request was now faster than the transition, well... Your conditional elements may not get displayed anymore.

Reproduction

Svelte5 REPL (broken)

Svelte5 / SvelteKit form Example (Broken)

Svelte4 Repl (working as intended)

Instructions:

  • Click the button
  • See h1 slide in
  • Click button again
    • h1 vanishes in Svelte5
    • h1 stays visible in Svelte4 (expected)

Logs

No response

System Info

System:
    OS: Linux 5.15 Arch Linux (WSL)
    CPU: (24) x64 AMD Ryzen 9 3900X 12-Core Processor
    Memory: 5.91 GB / 15.57 GB
    Container: Yes
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 22.1.0 - ~/.nvm/versions/node/v22.1.0/bin/node
    npm: 10.7.0 - ~/.nvm/versions/node/v22.1.0/bin/npm
    bun: 1.0.2 - ~/.bun/bin/bun
  Browsers:
    Chromium: 124.0.6367.155
  npmPackages:
    svelte: 5.0.0-next.123 => 5.0.0-next.123

Severity

blocking an upgrade

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

No branches or pull requests

3 participants