svelte icon indicating copy to clipboard operation
svelte copied to clipboard

[fix] When intro was triggered before the outro, that outro was canceled

Open bfanger opened this issue 3 years ago • 2 comments

The issue

  1. When the block.i (intro) is called it registers a callback (via add_render_callback)
  2. Then the block.o (outro) is called and start the outro and adds a callback to detach on outroend
  3. 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.

bfanger avatar Feb 21 '22 22:02 bfanger

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 avatar Apr 18 '22 10:04 bfanger

Issue : REPL Fix by using '|local modifier : REPL

induratized avatar Aug 04 '22 15:08 induratized

@bfanger is attempting to deploy a commit to the Svelte Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar Feb 22 '23 07:02 vercel[bot]