From 2b4cadbf74bb781d45d1aa253177e7adb455b039 Mon Sep 17 00:00:00 2001 From: Richard Musiol Date: Wed, 8 Nov 2017 17:58:32 +0100 Subject: [PATCH 1/4] fix out-in transition getting stuck with v-if An out-in transition could get stuck if the child with v-if was not yet shown and then replaced with a different child. In this case, "afterLeave" would never get fired, thus "_leaving" stayed true indefinitely. This was likely to happen with vue-router and asynchronous data loading before the new page is shown. Fixes #6687. --- src/platforms/web/runtime/components/transition.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/platforms/web/runtime/components/transition.js b/src/platforms/web/runtime/components/transition.js index 857c88f35e5..52a3ff82d35 100644 --- a/src/platforms/web/runtime/components/transition.js +++ b/src/platforms/web/runtime/components/transition.js @@ -160,6 +160,7 @@ export default { if ( oldChild && oldChild.data && + oldChild.elm.nodeType !== Node.COMMENT_NODE && !isSameChild(child, oldChild) && !isAsyncPlaceholder(oldChild) ) { From e24747cbb8e0e0627c7f31865a6c566766ea083e Mon Sep 17 00:00:00 2001 From: Richard Musiol Date: Thu, 9 Nov 2017 12:20:48 +0100 Subject: [PATCH 2/4] inline constant to make flow happy --- src/platforms/web/runtime/components/transition.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platforms/web/runtime/components/transition.js b/src/platforms/web/runtime/components/transition.js index 52a3ff82d35..43f0df40740 100644 --- a/src/platforms/web/runtime/components/transition.js +++ b/src/platforms/web/runtime/components/transition.js @@ -160,7 +160,7 @@ export default { if ( oldChild && oldChild.data && - oldChild.elm.nodeType !== Node.COMMENT_NODE && + oldChild.elm.nodeType !== 8 && // Node.COMMENT_NODE !isSameChild(child, oldChild) && !isAsyncPlaceholder(oldChild) ) { From 6b4d37490aa34f4a54e83b4378816a3e1f8c8846 Mon Sep 17 00:00:00 2001 From: Richard Musiol Date: Fri, 10 Nov 2017 11:38:15 +0100 Subject: [PATCH 3/4] check that oldChild.elm is set --- src/platforms/web/runtime/components/transition.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/platforms/web/runtime/components/transition.js b/src/platforms/web/runtime/components/transition.js index 43f0df40740..c80ec4493b9 100644 --- a/src/platforms/web/runtime/components/transition.js +++ b/src/platforms/web/runtime/components/transition.js @@ -160,6 +160,7 @@ export default { if ( oldChild && oldChild.data && + oldChild.elm && oldChild.elm.nodeType !== 8 && // Node.COMMENT_NODE !isSameChild(child, oldChild) && !isAsyncPlaceholder(oldChild) From fcceb57a1a6e7b89772e91d302955f80a97f734c Mon Sep 17 00:00:00 2001 From: Evan You Date: Thu, 16 Nov 2017 09:21:12 -0500 Subject: [PATCH 4/4] Update transition.js --- src/platforms/web/runtime/components/transition.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/platforms/web/runtime/components/transition.js b/src/platforms/web/runtime/components/transition.js index c80ec4493b9..01285505988 100644 --- a/src/platforms/web/runtime/components/transition.js +++ b/src/platforms/web/runtime/components/transition.js @@ -160,10 +160,10 @@ export default { if ( oldChild && oldChild.data && - oldChild.elm && - oldChild.elm.nodeType !== 8 && // Node.COMMENT_NODE !isSameChild(child, oldChild) && - !isAsyncPlaceholder(oldChild) + !isAsyncPlaceholder(oldChild) && + // #6687 component root is a comment node + !(oldChild.componentInstance && oldChild.componentInstance._vnode.isComment) ) { // replace old child transition data with fresh one // important for dynamic transitions!