remove child node before set default value

This commit is contained in:
Yanzhen Yu
2026-04-01 12:00:00 +08:00
parent 0a502e83ed
commit fbfdafae34

View File

@@ -106,6 +106,12 @@ function buildNode(n: serializedNodeWithId, doc: Document): Node | null {
}
if (isTextarea || isRemoteOrDynamicCss) {
const child = doc.createTextNode(value);
// https://github.com/rrweb-io/rrweb/issues/112
for (const c of Array.from(node.childNodes)) {
if (c.nodeType === node.TEXT_NODE) {
node.removeChild(c);
}
}
node.appendChild(child);
continue;
}