Skip to content

Commit f7d02b1

Browse files
committed
Preserve annotation editor keyboard input
1 parent 3a3b0e6 commit f7d02b1

1 file changed

Lines changed: 9 additions & 13 deletions

File tree

‎apps/desktop/src/preview/PickPreload.ts‎

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1229,19 +1229,15 @@ function startAnnotation(): void {
12291229
});
12301230
};
12311231
submit.addEventListener("click", () => submitAnnotation("attach"));
1232-
root.addEventListener(
1233-
"keydown",
1234-
(event) => {
1235-
const submission = event.target === comment ? resolveAnnotationSubmission(event) : null;
1236-
// Isolate annotation controls before the event reaches bubble-phase
1237-
// listeners installed by the inspected page.
1238-
event.stopImmediatePropagation();
1239-
if (!submission) return;
1240-
event.preventDefault();
1241-
submitAnnotation(submission);
1242-
},
1243-
{ capture: true },
1244-
);
1232+
root.addEventListener("keydown", (event) => {
1233+
const submission = event.target === comment ? resolveAnnotationSubmission(event) : null;
1234+
// Keep this in the bubble phase so editor inputs receive the event before
1235+
// it is isolated from listeners installed by the inspected page.
1236+
event.stopImmediatePropagation();
1237+
if (!submission) return;
1238+
event.preventDefault();
1239+
submitAnnotation(submission);
1240+
});
12451241

12461242
window.addEventListener("pointermove", onPointerMove, { capture: true, passive: false });
12471243
window.addEventListener("pointerdown", onPointerDown, { capture: true, passive: false });

0 commit comments

Comments
 (0)