svelte
svelte copied to clipboard
Unfinished transition does not update bound variable
Describe the bug
When you use {#if} to transition out an element, but negate the if mid-transition, the transition does not finish and re-transitions to the shown state. If this happens, the variables that are bound to child components do not get updated when they were updated mid-transition.
Reproduction
https://svelte.dev/repl/0949cb362a444e5ca5792b1323b23af0?version=3.53.1
Logs
No response
System Info
System:
OS: Linux 5.15 Ubuntu 22.04.1 LTS 22.04.1 LTS (Jammy Jellyfish)
CPU: (16) x64 AMD Ryzen 7 3800X 8-Core Processor
Memory: 15.18 GB / 31.30 GB
Container: Yes
Shell: 5.8.1 - /usr/bin/zsh
Binaries:
Node: 16.15.1 - ~/.nvm/versions/node/v16.15.1/bin/node
Yarn: 3.2.1 - ~/.yarn/bin/yarn
npm: 8.19.2 - ~/.nvm/versions/node/v16.15.1/bin/npm
Browsers:
Chrome: 107.0.5304.110
npmPackages:
svelte: ^3.53.1 => 3.53.1
Severity
annoyance
Currently working around it by surrounding all of my animated elements with {#key} so they get recreated.