From 7e44e81e4270779f7f05e57cdb3ac6ab8e343aca Mon Sep 17 00:00:00 2001 From: Aaron Dodson Date: Thu, 20 Feb 2025 09:56:41 -0800 Subject: [PATCH] fix: Fix bug that prevented editing workspace comments on Firefox. (#8779) * fix: Fix bug that prevented editing workspace comments on Firefox. * chore: Add a docstring for getTextArea(). * refactor: Use isTargetInput() instead of comparing to comment textarea. --- core/comments/rendered_workspace_comment.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/core/comments/rendered_workspace_comment.ts b/core/comments/rendered_workspace_comment.ts index ff2133574..f4885df46 100644 --- a/core/comments/rendered_workspace_comment.ts +++ b/core/comments/rendered_workspace_comment.ts @@ -208,8 +208,14 @@ export class RenderedWorkspaceComment private startGesture(e: PointerEvent) { const gesture = this.workspace.getGesture(e); if (gesture) { - gesture.handleCommentStart(e, this); - this.workspace.getLayerManager()?.append(this, layers.BLOCK); + if (browserEvents.isTargetInput(e)) { + // If the text area was the focus, don't allow this event to bubble up + // and steal focus away from the editor/comment. + e.stopPropagation(); + } else { + gesture.handleCommentStart(e, this); + this.workspace.getLayerManager()?.append(this, layers.BLOCK); + } common.setSelected(this); } }