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.
This commit is contained in:
Aaron Dodson
2025-02-20 09:56:41 -08:00
committed by GitHub
parent 29950fd872
commit 7e44e81e42

View File

@@ -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);
}
}