Skip to content

Commit 4ac2da8

Browse files
committed
perf: Preserve child nodes during tag name change (#8597)
Modified Neo.main.DeltaUpdates.changeNodeName to use appendChild instead of innerHTML when moving children to the new element. This prevents the destruction of DOM state (focus, scroll, input values) and maintains node identity.
1 parent 0c69c9c commit 4ac2da8

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/main/DeltaUpdates.mjs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,9 @@ class DeltaUpdates extends Base {
126126
clone.setAttribute(attribute.nodeName, attribute.nodeValue)
127127
}
128128

129-
clone.innerHTML= node.innerHTML;
129+
while (node.firstChild) {
130+
clone.appendChild(node.firstChild)
131+
}
130132

131133
node.parentNode.replaceChild(clone, node)
132134
}

0 commit comments

Comments
 (0)