Skip to content

Commit fefb60a

Browse files
fix(desktop): keep annotation clicks out of dialog handlers
1 parent 7aae411 commit fefb60a

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1461,6 +1461,20 @@ function startAnnotation(sendEnabled: boolean): void {
14611461
submitAnnotation(submission);
14621462
});
14631463

1464+
// Dialog backdrop-dismiss handlers must not receive annotation control clicks.
1465+
for (const type of [
1466+
"pointerdown",
1467+
"pointerup",
1468+
"mousedown",
1469+
"mouseup",
1470+
"click",
1471+
"dblclick",
1472+
"auxclick",
1473+
"contextmenu",
1474+
]) {
1475+
root.addEventListener(type, (event) => event.stopPropagation());
1476+
}
1477+
14641478
window.addEventListener("pointermove", onPointerMove, { capture: true, passive: false });
14651479
window.addEventListener("pointerdown", onPointerDown, { capture: true, passive: false });
14661480
window.addEventListener("pointerup", onPointerUp, { capture: true, passive: false });

0 commit comments

Comments
 (0)