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

Svelte 5: Transitions cause errors when the state changes frequently #13047

Closed
Serator opened this issue Aug 27, 2024 · 2 comments · Fixed by #13058
Closed

Svelte 5: Transitions cause errors when the state changes frequently #13047

Serator opened this issue Aug 27, 2024 · 2 comments · Fixed by #13058
Labels
Milestone

Comments

@Serator
Copy link

Serator commented Aug 27, 2024

Describe the bug

If you change state quickly, Svelte transitions start throwing warnings and errors.

Probably related to this change.

iShot_2024-08-28_00.01.06.mp4

Reproduction

Link

Logs

No response

System Info

Svelte 5.0.0-next.240

Severity

annoyance

@trueadm trueadm added the bug label Aug 28, 2024
@trueadm trueadm added this to the 5.0 milestone Aug 28, 2024
@trueadm
Copy link
Contributor

trueadm commented Aug 28, 2024

This is happening because we're dividing by 0 in several places which is giving us NaN. We can either guard against NaN and default to 0 or we can come up with an alternative approach.

@Rich-Harris
Copy link
Member

We can probably just skip creating the second animation if delta === 0

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

Successfully merging a pull request may close this issue.

3 participants