diff --git a/src/rebuild.ts b/src/rebuild.ts index 94cc244c..7200ef81 100644 --- a/src/rebuild.ts +++ b/src/rebuild.ts @@ -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; }