Skip to content

chore: Svelte 4 #408

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

Merged
merged 9 commits into from
Jun 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
title: Global transitions
---

Ordinarily, transitions will only play on elements when their direct containing block is added or destroyed. In the example here, toggling the visibility of the entire list does not apply transitions to individual list elements.

Instead, we'd like transitions to not only play when individual items are added and removed with the slider but also when we toggle the checkbox.

We can achieve this with a _global_ transition, which plays when _any_ block containing the transitions is added or removed:

```svelte
/// file: App.svelte
<div transition:slide+++|global+++>
{item}
</div>
```

> In Svelte 3, transitions were global by default and you had to use the `|local` modifier to make them local.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

{#if showItems}
{#each items.slice(0, i) as item}
<div transition:slide|local>
<div transition:slide|global>
{item}
</div>
{/each}
Expand Down

This file was deleted.

Loading