From 4861c7d98a33f5408d0798ef068b69bffed94a45 Mon Sep 17 00:00:00 2001 From: Richard Knoll Date: Thu, 2 May 2024 08:38:40 -0700 Subject: [PATCH] fix: prevent duplication of comment icon bubbles (#8053) --- core/icons/comment_icon.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/core/icons/comment_icon.ts b/core/icons/comment_icon.ts index 591fe9727..df54560c5 100644 --- a/core/icons/comment_icon.ts +++ b/core/icons/comment_icon.ts @@ -264,15 +264,18 @@ export class CommentIcon extends Icon implements IHasBubble, ISerializable { } async setBubbleVisible(visible: boolean): Promise { - if (visible && (this.textBubble || this.textInputBubble)) return; - if (!visible && !(this.textBubble || this.textInputBubble)) return; - + if (this.bubbleVisiblity === visible) return; this.bubbleVisiblity = visible; - if (!this.sourceBlock.rendered || this.sourceBlock.isInFlyout) return; - await renderManagement.finishQueuedRenders(); + if ( + !this.sourceBlock.rendered || + this.sourceBlock.isInFlyout || + this.sourceBlock.isInsertionMarker() + ) + return; + if (visible) { if (this.sourceBlock.isEditable()) { this.showEditableBubble();