-
-
Notifications
You must be signed in to change notification settings - Fork 9.1k
fix(runtime-vapor): animate vapor component moves in TransitionGroup #14866
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
edison1105
merged 6 commits into
minor
from
edison/fix-14862-vapor-transition-group-key-split
May 22, 2026
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
effbec6
fix(runtime-vapor): animate vapor component moves in TransitionGroup
edison1105 722cab1
fix(runtime-vapor): animate vdom component moves in vapor TransitionG…
edison1105 59c1e57
test(runtime-vapor): cover vapor component moves in vdom TransitionGroup
edison1105 b818435
fix(runtime-vapor): track root slot updates in TransitionGroup
edison1105 a5db91d
fix(runtime-vapor): delegate async root slot wrappers to TransitionGroup
edison1105 382c0ef
fix(runtime-vapor): defer TransitionGroup moves until child updates f…
edison1105 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
packages-private/vapor-e2e-test/interop/components/VdomTransitionGroup.vue
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| <script setup lang="ts"> | ||
| import { ref } from 'vue' | ||
| import VaporExpandingItem from '../../transition-group/components/VaporExpandingItem.vue' | ||
|
|
||
| const items = ref( | ||
| [...Array(2)].map((_, i) => ({ | ||
| id: i + 1, | ||
| isOpened: false, | ||
| })), | ||
| ) | ||
|
|
||
| function toggleExpansion() { | ||
| items.value[0].isOpened = !items.value[0].isOpened | ||
| } | ||
| </script> | ||
|
|
||
| <template> | ||
| <div class="trans-group-vapor-component-move"> | ||
| <button @click="toggleExpansion">toggle expansion of first element</button> | ||
| <div> | ||
| <transition-group name="group" tag="div" class="item-wrapper"> | ||
| <VaporExpandingItem | ||
| v-for="i in items" | ||
| :key="`${i.id}-${i.isOpened ? 'true' : 'false'}`" | ||
| :id="i.id" | ||
| :is-opened="i.isOpened" | ||
| /> | ||
| </transition-group> | ||
| </div> | ||
| </div> | ||
| </template> | ||
|
|
||
| <style> | ||
| .item-wrapper { | ||
| display: flex; | ||
| flex-wrap: wrap; | ||
| gap: 5px; | ||
| width: 430px; | ||
| } | ||
|
|
||
| .group-move, | ||
| .group-enter-active, | ||
| .group-leave-active { | ||
| transition: all 50ms cubic-bezier(0.55, 0, 0.1, 1); | ||
| } | ||
|
|
||
| .group-leave-active { | ||
| position: absolute; | ||
| } | ||
| </style> |
44 changes: 44 additions & 0 deletions
44
...or-e2e-test/transition-group/cases/interop/keyed-vdom-component-move-after-key-change.vue
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| <script setup vapor> | ||
| import { ref } from 'vue' | ||
| import VdomExpandingItem from '../../components/VdomExpandingItem.vue' | ||
|
|
||
| const items = ref( | ||
| [...Array(2)].map((_, i) => ({ | ||
| id: i + 1, | ||
| isOpened: false, | ||
| })), | ||
| ) | ||
|
|
||
| function toggleExpansion() { | ||
| items.value[0].isOpened = !items.value[0].isOpened | ||
| } | ||
| </script> | ||
|
|
||
| <template> | ||
| <div class="keyed-vdom-component-move-after-key-change"> | ||
| <button @click="toggleExpansion">toggle expansion of first element</button> | ||
| <div> | ||
| <transition-group name="group" tag="div" class="item-wrapper"> | ||
| <VdomExpandingItem | ||
| v-for="i in items" | ||
| :key="`${i.id}-${i.isOpened ? 'true' : 'false'}`" | ||
| :id="i.id" | ||
| :is-opened="i.isOpened" | ||
| /> | ||
| </transition-group> | ||
| </div> | ||
| </div> | ||
| </template> | ||
|
|
||
| <style> | ||
| .item-wrapper { | ||
| display: flex; | ||
| flex-wrap: wrap; | ||
| gap: 5px; | ||
| width: 430px; | ||
| } | ||
|
|
||
| .keyed-vdom-component-move-after-key-change .group-move { | ||
| transition: transform 300ms ease; | ||
| } | ||
| </style> |
21 changes: 21 additions & 0 deletions
21
...e2e-test/transition-group/cases/vapor-transition-group/async-root-slot-component-move.vue
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| <script setup vapor> | ||
| import { defineVaporAsyncComponent, ref } from 'vue' | ||
| import RootSlot from '../../components/RootSlot.vue' | ||
|
|
||
| const AsyncRootSlot = defineVaporAsyncComponent(() => Promise.resolve(RootSlot)) | ||
| const items = ref(['a', 'b', 'c']) | ||
| const moveClick = () => (items.value = ['d', 'b', 'a']) | ||
| </script> | ||
|
|
||
| <template> | ||
| <div class="async-root-slot-component-move"> | ||
| <button @click="moveClick">async root slot button</button> | ||
| <div> | ||
| <transition-group name="group"> | ||
| <AsyncRootSlot key="async-root-slot"> | ||
| <div v-for="item in items" :key="item" class="test">{{ item }}</div> | ||
| </AsyncRootSlot> | ||
| </transition-group> | ||
| </div> | ||
| </div> | ||
| </template> |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.