fix(TransitionGroup): should render the VNode that is actually keyed #3568
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.
Fix: #3552
In the current implementation, the
TransitionGroup
component will extract the raw vnodes(getTransitionRawChildren
) as the content it will render. This is problematic in some scenarios, e.g.The above template will be compiled as:
This means that the actual content rendered by the
TransitionGroup
component is:The behavior of the
TransitionGroup
component to extract the raw VNodes breaks the hierarchical structure of the virtual DOM tree, leading to subsequent rendering issues, but this is necessary to set the transition hook.My idea is to still extract raw vnodes in order to set the transition hook, but when rendering, we need to render the node that is actually keyed, this means we need to support transition when removing
Fragment
.