From acaffcb65a01851c40478cbbf4b5aa132dfca836 Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 23 Jan 2026 22:14:24 +0800 Subject: [PATCH] fix: prevent angle edit dialog from triggering navigation on close --- components/angle-edit-dialog.tsx | 16 +++++++++++++++- components/image-annotator.tsx | 16 +++++++++------- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/components/angle-edit-dialog.tsx b/components/angle-edit-dialog.tsx index edd42c3..f1935b2 100644 --- a/components/angle-edit-dialog.tsx +++ b/components/angle-edit-dialog.tsx @@ -171,7 +171,21 @@ export function AngleEditDialog({ return ( - + { + // 阻止点击遮罩层关闭对话框(防止意外触发导航) + if (isProcessing) { + e.preventDefault(); + } + }} + onEscapeKeyDown={(e) => { + // 处理过程中阻止 ESC 关闭 + if (isProcessing) { + e.preventDefault(); + } + }} + > {/* 紧凑标题栏 */}
diff --git a/components/image-annotator.tsx b/components/image-annotator.tsx index f593460..8c4766d 100644 --- a/components/image-annotator.tsx +++ b/components/image-annotator.tsx @@ -1752,14 +1752,16 @@ export function ImageAnnotator({ imageUrl, onConfirm, onCancel, initialResizeMod
)} - {/* 角度调整对话框 */} + {/* 角度调整对话框 - 包裹在阻止事件冒泡的 div 中 */} {showAngleEditDialog && originalImageUrl && ( - +
e.stopPropagation()} onMouseDown={(e) => e.stopPropagation()}> + +
)}
);