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

When use slot, #key directive and transition together transition|local doesn't work #6979

Open
MrWaip opened this issue Dec 2, 2021 · 3 comments

Comments

@MrWaip
Copy link

MrWaip commented Dec 2, 2021

Describe the bug

I've wrapped Container in key directive in order to re-render it under certain condition and passed element with transition:fade|local in the slot. Tried to place span in another .svelte component and expected, that local transition would't be affected by parent's behaviour, but the glitch is still there.

It seems like the new instance of a component because of key has already been rendered, but the old one is still there, because of it has been hold by the transition

{#key key}
  <Container>
	  <span transition:fade|local>
		  Error example
	  </span>
  </Container>
{/key}	

ezgif-6-7d0a1b46fe63

Reproduction

Here is a reproduction:

https://svelte.dev/repl/f5de3baa974f4d4bb8f830e1e0b59e63?version=3.44.2

Logs

No response

System Info

nope

Severity

annoyance

@tohodakilla
Copy link

I wouldn't call it just annoyance, exactly this issue prevents me from having full page transitions in svelteKit on __layout.svelte level, so app that im making using lovely svelte instead of being absolutely beautiful (with transitions) is just beautiful.

@7nik
Copy link

7nik commented Dec 11, 2021

The out-transition blocks umounting the whole block until transition ends so you temporarily get two components. It's written in the docs.
But there is a real bug #5950 - in the #key block a local in-transition isn't played at all.

@tohodakilla
Copy link

Yes you should get two components temporarily, but when I use #key + local transition isnt played and im left with two components (in my case SvelteKit - two pages being displayed at once) and they are gone only after refresh.

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

No branches or pull requests

3 participants