-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
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
fix #6687 out-in transition getting stuck with v-if #7023
Conversation
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.
Flow is unhappy with |
I guess just use the constant value 8 would be fine. |
I've changed it to the constant value. One of the tests is still failing. I don't know enough about this code to say if this failure is really something bad or if the behavior is still fine this way and the test could be changed. Can someone with more knowledge on this please help me here? |
Seems you have to update the test to reflect your fix. |
@@ -160,6 +160,7 @@ export default { | |||
if ( | |||
oldChild && | |||
oldChild.data && | |||
oldChild.elm.nodeType !== 8 && // Node.COMMENT_NODE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oldChild.elm
could be undefined
, so checking existence would be necessary.
oldChild.elm && oldChild.elm.nodeType !== 8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In which situation would this happen?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is why 'async components with transition-mode out-in' test failing. 🙂
@jkzing You are right, this indeed fixed the test. Thanks! I'm a bit surprised, because the log output of the test failure didn't show any error related to Is this good to merge now? |
Any update? |
Thanks for the PR @neelance ! I tweaked the implementation a little bit because the transition component is reused in Weex and should ideally be decoupled from the DOM. |
@yyx990803 Cool! Thanks for merging. |
What kind of change does this PR introduce? (check at least one)
Does this PR introduce a breaking change? (check one)
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.