From 37c293c4bd33221be8ab85b0d34c2a3288c44989 Mon Sep 17 00:00:00 2001 From: Yanzhen Yu Date: Wed, 1 Apr 2026 12:00:00 +0800 Subject: [PATCH] fix useless code introduced by resolving conflicts --- src/replay/index.ts | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/src/replay/index.ts b/src/replay/index.ts index 5ce1d07a..ff92c23a 100644 --- a/src/replay/index.ts +++ b/src/replay/index.ts @@ -180,23 +180,6 @@ export class Replayer { for (const d of inputMap.values()) { this.applyInput(d); } - - for (const [frag, parent] of this.fragmentParentMap.entries()) { - this.mirror.map[parent.__sn.id] = parent; - /** - * If we have already set value attribute on textarea, - * then we could not apply text content as default value any more. - */ - if ( - parent.__sn.type === NodeType.Element && - parent.__sn.tagName === 'textarea' && - frag.textContent - ) { - ((parent as unknown) as HTMLTextAreaElement).value = frag.textContent; - } - parent.appendChild(frag); - } - this.fragmentParentMap.clear(); }); this.emitter.on(ReplayerEvents.PlayBack, () => { this.firstPlayedEvent = null; @@ -1084,7 +1067,9 @@ export class Replayer { if (!target) { return this.warnNodeNotFound(d, mutation.id); } - let parent: INode | null | ShadowRoot = this.mirror.getNode(mutation.parentId); + let parent: INode | null | ShadowRoot = this.mirror.getNode( + mutation.parentId, + ); if (!parent) { return this.warnNodeNotFound(d, mutation.parentId); } @@ -1140,7 +1125,9 @@ export class Replayer { if (!this.iframe.contentDocument) { return console.warn('Looks like your replayer has been destroyed.'); } - let parent: INode | null | ShadowRoot = this.mirror.getNode(mutation.parentId); + let parent: INode | null | ShadowRoot = this.mirror.getNode( + mutation.parentId, + ); if (!parent) { if (mutation.node.type === NodeType.Document) { // is newly added document, maybe the document node of an iframe