-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Slot having stale state if transition is reversed midway #5394
Comments
I think I am having the same problem:
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
I'm reopening this since there's a PR pending for it (#6314) |
This should be fixed now in 3.40.3 - https://svelte.dev/repl/405911d112e040818e26e30f37c61b8d?version=3.40.3 |
I had the same issue; thanks to everyone involved in the fix :) |
It seems this bug still occurs in some cases. In this version of the REPL, if https://svelte.dev/repl/09afd379856840c589c88ff5fdef2737?version=3.44.1 |
Describe the bug
Slot content seems to have stale state if the component were to be destroyed, but the transition was reversed midway.
To Reproduce
REPL.
I apologize if the example is excessive, I just tried to recreate the components from my app as close as possible. My case:
Steps:
text
and local variableloading
are now stale: thetext
prop is the same as it was before the transition started and loading is intrue
state. They'll never update no matter how much you tryfalse
state totrue
state, therefore the interface doesn't change)Expected behavior
Prop should be updated, and the local state should be independent.
Stacktraces
N/A
Information about your Svelte project:
Severity
Not really. I use shady timers to avoid this bug and it is not critical for me.
Additional context
I added a timer-based fix on line 21 of the
ShowSingleItem.svelte
component. It seems to me that this timer value is somehow connected to transition duration, althoughscale
has a default of 400, but the fix works fine for me with a value of 350ms.The text was updated successfully, but these errors were encountered: