-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Closed as duplicate of#12138
Description
Describe the bug
Title says it all, here is an example:
<!-- Parent -->
<script>
import Component from "./Component.svelte"
let visible = $state(true)
</script>
<input type="checkbox" bind:checked={visible} />
{#if visible}
<Component />
{/if}<!-- Child Component -->
<script lang="ts">
import { fly } from "svelte/transition"
let status = $state("idle")
$inspect(status)
</script>
<p transition:fly={{ y: 20, duration: 300 }} onoutrostart={() => (status = 'outro')}>status: {status}</p>What happens
statusis updated by theonoutrostartlistener$inspect(status)runs and prints thatstatus = 'outro'status: {status}is NOT updated ❌
What I expect to happen
status: {status} should be updated
I guess elements that are transitioning out are removed from receiving state updates. However this should only happen when the outro/transition ends, not when it starts.
Reproduction
https://svelte.dev/playground/a221ea9296a1411da4d3fb3563aeb183?version=latest
Logs
System Info
playgroundSeverity
annoyance
Metadata
Metadata
Assignees
Labels
No labels