Skip to content

Commit 05ca9f5

Browse files
committed
[B] Prevent escape from bubbling when focused on edit annotation dialog
1 parent 12be747 commit 05ca9f5

File tree

1 file changed

+6
-0
lines changed
  • client/src/global/components/Annotation/Annotation/UserContent

1 file changed

+6
-0
lines changed

client/src/global/components/Annotation/Annotation/UserContent/index.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ export default function AnnotationDetail({
4646
const editUID = useUID();
4747
const editDialog = useDialog({ modal: false, dismissalMode: "explicit" });
4848

49+
const handleEditKeyDown = e => {
50+
// Prevent the event from bubbling up to the main dialog
51+
e.stopPropagation();
52+
};
53+
4954
const startReply = () => {
5055
setAction("replying");
5156
};
@@ -199,6 +204,7 @@ export default function AnnotationDetail({
199204
<Styled.EditDialog
200205
ref={editDialog.dialogRef}
201206
id={editUID}
207+
onKeyDown={handleEditKeyDown}
202208
{...(editDialog.open ? {} : { inert: "" })}
203209
>
204210
<Editor

0 commit comments

Comments
 (0)