diff --git a/packages/rrweb/src/replay/index.ts b/packages/rrweb/src/replay/index.ts index ab286ee441..7dafb54c09 100644 --- a/packages/rrweb/src/replay/index.ts +++ b/packages/rrweb/src/replay/index.ts @@ -1766,9 +1766,15 @@ export class Replayer { if (attributeName === 'value' && target.nodeName === 'TEXTAREA') { // this may or may not have an effect on the value property (which is what is displayed) // depending on whether the textarea has been modified by the user yet - (target as Element | RRElement).replaceChildren( - document.createTextNode(value), + // TODO: replaceChildNodes is not available in RRDom + const textarea = target as TNode; + textarea.childNodes.forEach((c) => + textarea.removeChild(c as TNode), ); + let tn = target.ownerDocument?.createTextNode(value as string); + if (tn) { + textarea.appendChild(tn as TNode); + } } else { (target as Element | RRElement).setAttribute( attributeName,