Skip to content

Commit 582a893

Browse files
committed
really fix out-in mode
1 parent 39bcd60 commit 582a893

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/platforms/web/runtime/components/transition.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,18 @@ export default {
6060
const oldChild = getRealChild(oldRawChild)
6161
if (mode && oldChild && oldChild.data && oldChild.key !== child.key) {
6262
if (mode === 'out-in') {
63-
// return old node
64-
// and queue an update when the leave finishes
65-
if (!oldChild.elm._leaveCb && oldRawChild.data.transition) {
63+
if (
64+
!oldChild.elm._leaveCb && // not already leaving
65+
oldChild.data.transition // not already left
66+
) {
6667
leave(oldChild, () => {
67-
oldRawChild.data.transition = null
68+
// mark left & avoid triggering leave transition again
69+
oldChild.data.transition = null
6870
this.$forceUpdate()
6971
})
7072
}
71-
if (oldRawChild.data.transition) {
73+
// return old node if not left yet
74+
if (oldChild.data.transition) {
7275
return oldRawChild
7376
}
7477
} else if (mode === 'in-out') {

0 commit comments

Comments
 (0)