Skip to content

Svelte 5: Transition doesn't worked in nested if statements #11953

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

Closed
98mux opened this issue Jun 7, 2024 · 3 comments
Closed

Svelte 5: Transition doesn't worked in nested if statements #11953

98mux opened this issue Jun 7, 2024 · 3 comments

Comments

@98mux
Copy link
Contributor

98mux commented Jun 7, 2024

Describe the bug

Probably been reported before, but in case it hasn't

{#if variable}
<Component/> <!-- transition animation works -->
{/if}

{#if variable}
{#if false}
<Component/> <!-- transition animation doesn't work -->
{:else}
<div/>
{/if}
{/if}

Reproduction

https://svelte-5-preview.vercel.app/#H4sIAAAAAAAAE5VRQU7DMBD8imWQaKXQpEVc3CQSF17AjXBI401rNbEje5NSWf47ctyGAgWJ23p2Zna9Y2ktGjCUvVoqyxYoo09dRyOKx84_zAANAo2oUb2uPJKaSosO80IWKNpOaSQvYJDUWrWkoIvYvxZBV1DPagCJWZKM3BosEWZ12RiYr6fW6korjacx6aZHVJIoWTWi2md2Ns9yOxqO9HVwCLVzuQYDmMZB5df8ywF1D87lzyUHwhUYeYfkoPT-Qv-LevVN7VXmy9hC2htRE7N0p2pc0fl_F5j6M8V5IS2DM_qJxaIOvKk8ea2uEyWNaKu4qAVwysa1oilQT_5norYuObhzpkESoy6lESiU9LleJsTFQIRkXpRZy3tdehZ7SBLnwinQC7gYPNvgsYFxGheDDefYlNV-q1Uv-X2lGqXZpulhHXoHwXHHHpOkez8hOxDbHV5Abtxn9P15iTf3AXg0Qk_mAgAA

Logs

No response

System Info

repl

Severity

annoyance

@brunnerh
Copy link
Member

brunnerh commented Jun 7, 2024

This is expected.
If you want to react to outer blocks, the transition has to be set to global:

<div in:fade|global={{ duration:300 }}>

@Conduitry
Copy link
Member

This is the same behavior as in v4. See #8632.

@Conduitry Conduitry closed this as not planned Won't fix, can't repro, duplicate, stale Jun 7, 2024
@98mux
Copy link
Contributor Author

98mux commented Jun 7, 2024

Oh my mistake, forgot about that

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