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

svelte 4.0.1 transition, is it a bug? #8887

Closed
easyfrog opened this issue Jun 30, 2023 · 4 comments
Closed

svelte 4.0.1 transition, is it a bug? #8887

easyfrog opened this issue Jun 30, 2023 · 4 comments

Comments

@easyfrog
Copy link

Describe the bug

{#if outter_condition}
     {#if inner_condition}
     <div transition:fly={{y: 100}}>Hello world</div>
     {/if}
{/if}

If the inner_condition change to true before the outter_condition. The transition will not working.

Reproduction

https://svelte.dev/repl/31d1a635d66143888a620a7705b2fbf8?version=4.0.1

Logs

No response

System Info

System:
    OS: macOS 13.4.1
    CPU: (4) x64 Intel(R) Core(TM) i5-7267U CPU @ 3.10GHz
    Memory: 49.99 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.9.1 - /usr/local/bin/node
    npm: 8.19.1 - /usr/local/bin/npm
  Browsers:
    Chrome: 114.0.5735.198
    Firefox: 106.0.5
    Safari: 16.5.1

Severity

annoyance

@easyfrog easyfrog changed the title svelte 4.0.1 transition, it's a bug? svelte 4.0.1 transition, is it a bug? Jun 30, 2023
@gtm-nayan
Copy link
Contributor

Transitions were changed to be local by default in Svelte 4. So mounting/unmounting the outer block will not cause the transition to play on the inner block.

@gtm-nayan
Copy link
Contributor

You can add |global to the transition to revert to the old behaviour. There's another issue open for tracking making it more granular #8850, I'll close this one.

@gtm-nayan gtm-nayan closed this as not planned Won't fix, can't repro, duplicate, stale Jun 30, 2023
@easyfrog
Copy link
Author

easyfrog commented Jun 30, 2023

You can add |global to the transition to revert to the old behaviour. There's another issue open for tracking making it more granular #8850, I'll close this one.

Thanks. it works now.

But what does |local |global exactly means? Not found any info in the online documents. I develop SPA without kit.

@Conduitry
Copy link
Member

https://learn.svelte.dev/tutorial/global-transitions

https://svelte.dev/docs/element-directives#transition-fn

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