svelte
svelte copied to clipboard
[fix] When intro was triggered before the outro, that outro was canceled
The issue
- When the block.i (intro) is called it registers a callback (via add_render_callback)
- Then the block.o (outro) is called and start the outro and adds a callback to detach on outroend
- The render callback from the intro is executed, starts the intro and cancels the outro animation
This causes components that should've been destroyed to stay on the page.
#6152 #6812
The fix in this PR
Inside the intro render callback it checks if it is still current
and if it isn't (because an outro was triggered) it won't start the intro animation.
I've tried creating a unittest but I was not able to reproduce the timing defect inside the test environment.
The bug is clearly visible in the REPL
@bfanger is attempting to deploy a commit to the Svelte Team on Vercel.
A member of the Team first needs to authorize it.