Skip to content

Commit f764db4

Browse files
committed
more robust parent transition skip check
1 parent 7b4a5a1 commit f764db4

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,14 @@ function placeholder (h, rawChild) {
5454
: null
5555
}
5656

57+
function hasParentTransition (vnode) {
58+
while ((vnode = vnode.parent)) {
59+
if (vnode.data.transition) {
60+
return true
61+
}
62+
}
63+
}
64+
5765
export default {
5866
name: 'transition',
5967
props: transitionProps,
@@ -95,7 +103,7 @@ export default {
95103

96104
// if this is a component root node and the component's
97105
// parent container node also has transition, skip.
98-
if (this.$vnode.parent && this.$vnode.parent.data.transition) {
106+
if (hasParentTransition(this.$vnode)) {
99107
return rawChild
100108
}
101109

0 commit comments

Comments
 (0)