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(runtime-core): should also inherit the DOM el of the text nodes (… #6858

Merged
merged 3 commits into from Nov 10, 2022

Conversation

zhangzhonghe
Copy link
Member

@zhangzhonghe zhangzhonghe commented Oct 12, 2022

#6852)

fix #6852

Before | After

@zhangzhonghe zhangzhonghe marked this pull request as ready for review October 12, 2022 07:23
@@ -2391,6 +2391,11 @@ export function traverseStaticChildren(n1: VNode, n2: VNode, shallow = false) {
if (__DEV__ && c2.type === Comment && !c2.el) {
c2.el = c1.el
}
// #6852
// also inherit for text nodes
if (c2.type === Text && !c2.el) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel those codes could be refactored as:

if(!c2.el)(
  if((__DEV__ && c2.type === Comment)||c2.type === Text){
    c2.el = c1.el
  }
}

@yyx990803 yyx990803 merged commit 4049ffc into vuejs:main Nov 10, 2022
9 checks passed
chrislone pushed a commit to chrislone/core that referenced this pull request Feb 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

KeepAlive & root text node: Failed to execute 'insertBefore' on 'Node'
3 participants