From c340746a87987c5b631949f792fc08e21de85c18 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Fri, 28 Jan 2022 16:04:56 +0100 Subject: [PATCH] also remove text nodes when updating message body fixes #649 --- src/platform/web/ui/session/room/timeline/TextMessageView.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/platform/web/ui/session/room/timeline/TextMessageView.js b/src/platform/web/ui/session/room/timeline/TextMessageView.js index 510a676f..c0c0cfb0 100644 --- a/src/platform/web/ui/session/room/timeline/TextMessageView.js +++ b/src/platform/web/ui/session/room/timeline/TextMessageView.js @@ -42,7 +42,8 @@ export class TextMessageView extends BaseMessageView { } })); - const shouldRemove = (element) => element?.nodeType === Node.ELEMENT_NODE && element.className !== "ReplyPreviewView"; + // exclude comment nodes as they are used by t.map and friends for placeholders + const shouldRemove = (element) => element?.nodeType !== Node.COMMENT_NODE && element.className !== "ReplyPreviewView"; t.mapSideEffect(vm => vm.body, body => { while (shouldRemove(container.lastChild)) {