Skip to content
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(Teleport): component with multi roots should be removed when unmounted #3157

Merged
merged 2 commits into from
Mar 25, 2021
Merged

fix(Teleport): component with multi roots should be removed when unmounted #3157

merged 2 commits into from
Mar 25, 2021

Conversation

HcySunYang
Copy link
Member

@HcySunYang HcySunYang commented Feb 4, 2021

Fix: #3156
When removing the Teleport during patching, we cannot use the internal renderer method remove because there may be components in Teleport’s children, so we need to use unmount instead.
BTW: The reason why a component with a single root can be removed is because the vnode.el of the component is the root DOM node of the component, which is not the case for components with multiple roots.

@LinusBorg LinusBorg added scope: teleport ❗ p4-important Priority 4: this fixes bugs that violate documented behavior, or significantly improves perf. labels Feb 4, 2021
@LinusBorg
Copy link
Member

@HcySunYang There's an older PR #2870 which changes the behavior of remove() which you now don't use anymore in favor of unmount().

Does this change solve the issue of #2870 as well? Do you see any conflict?

@HcySunYang
Copy link
Member Author

@LinusBorg This PR did not solve #2870, I think we can merge #2870 first, and then I will deal with the conflict.

@LinusBorg LinusBorg added this to Planned, might need fresh review in Next Patch Feb 14, 2021
@LinusBorg LinusBorg added the 🛑 on hold This PR can't be merged until other work is finished label Feb 14, 2021
@yyx990803 yyx990803 merged commit 7769513 into vuejs:master Mar 25, 2021
Next Patch automation moved this from Planned, might need fresh review to Done Mar 25, 2021
@LinusBorg LinusBorg moved this from Done to Final (Reviewed by Evan) in Next Patch Mar 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
❗ p4-important Priority 4: this fixes bugs that violate documented behavior, or significantly improves perf. 🛑 on hold This PR can't be merged until other work is finished scope: teleport
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Teleported multi-root child component elements are not being removed together with parent component
3 participants