Skip to content

Snippet with conditional transition is not working #15266

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
TUTOR03 opened this issue Feb 11, 2025 · 5 comments
Closed

Snippet with conditional transition is not working #15266

TUTOR03 opened this issue Feb 11, 2025 · 5 comments

Comments

@TUTOR03
Copy link

TUTOR03 commented Feb 11, 2025

Describe the bug

For example you have a snippet accepting some boolean value as prop and showing content if this prop is true. Content inside snippet has transition on it. Also the snippet is rendered based on some condition in the parent component.
Even the prop you pass to snippet is alway true, the transition does not happen.

Reproduction

Check this playground reproduction

2025-02-11.16-18-07.mp4

https://svelte.dev/playground/hello-world?version=5.19.9#H4sIAAAAAAAAA31QTU_DMAz9K16GtFWaKELiUtoKbnDnRjl0jTsiMqdKvA0U5b-jpIUVgbjFz-8r9oLaPYpCPKDWBk7GaglrlIpRZmIjeqXRieLZC_4YIi8CYvOluh-GS3dEzRHbtg7_wjtDjMROFKJ0nVUD1w0BqP1gLIOHvpUIAXpr9rAaVTnblpxiZWh121DDGhncqzlBBReOW8Z132qH2Xz3SIT2N6HMv0Mb8ktHahiQQUX2OuqyEF38UvXJJk0Nl1Id4VyjiC0r7-XBtmmG65urEOqR3HC636TMpTqmhc9VHxry-RQaxgo_g_ydRZJoZ43ST7KkTAYRK8BPonJr83oEE3HapPd5XW4PzIbAUKdV91b5dVbV0wkXyal-MrudxtSlzEf6f8Kv-y7OaXOLhMx8xEYwvrMo2B4wvIRPdZI9WmsCAAA=

Logs

System Info

-

Severity

annoyance

@machak
Copy link

machak commented Feb 11, 2025

related to #14792 #14796 ?

@TUTOR03
Copy link
Author

TUTOR03 commented Feb 11, 2025

Seems so. Maybe will be fixed in #14796

@gyzerok
Copy link

gyzerok commented Feb 11, 2025

Don't think they are related, since animate and transition are different things

@adiguba
Copy link
Contributor

adiguba commented Feb 11, 2025

Hello,

This is normal : transition are local by default, and run only on their block, not parents :

https://svelte.dev/docs/svelte/transition#Local-vs-global

@Conduitry
Copy link
Member

Yup, this is working just how other transitions inside nested conditional blocks work, and can be controlled with the |global flag on the transition.

@Conduitry Conduitry closed this as not planned Won't fix, can't repro, duplicate, stale Feb 11, 2025
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

5 participants