fix: prevent angle edit dialog from triggering navigation on close
This commit is contained in:
parent
3366265f1d
commit
acaffcb65a
@ -171,7 +171,21 @@ export function AngleEditDialog({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Dialog open={open} onOpenChange={handleOpenChange}>
|
<Dialog open={open} onOpenChange={handleOpenChange}>
|
||||||
<DialogContent className="max-w-4xl p-0 gap-0 overflow-hidden border-none shadow-2xl bg-background/95 backdrop-blur-xl">
|
<DialogContent
|
||||||
|
className="max-w-4xl p-0 gap-0 overflow-hidden border-none shadow-2xl bg-background/95 backdrop-blur-xl"
|
||||||
|
onInteractOutside={(e) => {
|
||||||
|
// 阻止点击遮罩层关闭对话框(防止意外触发导航)
|
||||||
|
if (isProcessing) {
|
||||||
|
e.preventDefault();
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
onEscapeKeyDown={(e) => {
|
||||||
|
// 处理过程中阻止 ESC 关闭
|
||||||
|
if (isProcessing) {
|
||||||
|
e.preventDefault();
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
>
|
||||||
{/* 紧凑标题栏 */}
|
{/* 紧凑标题栏 */}
|
||||||
<div className="flex items-center justify-between px-4 py-3 border-b bg-muted/20">
|
<div className="flex items-center justify-between px-4 py-3 border-b bg-muted/20">
|
||||||
<div className="flex items-center gap-2">
|
<div className="flex items-center gap-2">
|
||||||
|
|||||||
@ -1752,14 +1752,16 @@ export function ImageAnnotator({ imageUrl, onConfirm, onCancel, initialResizeMod
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{/* 角度调整对话框 */}
|
{/* 角度调整对话框 - 包裹在阻止事件冒泡的 div 中 */}
|
||||||
{showAngleEditDialog && originalImageUrl && (
|
{showAngleEditDialog && originalImageUrl && (
|
||||||
<AngleEditDialog
|
<div onClick={(e) => e.stopPropagation()} onMouseDown={(e) => e.stopPropagation()}>
|
||||||
open={showAngleEditDialog}
|
<AngleEditDialog
|
||||||
onOpenChange={setShowAngleEditDialog}
|
open={showAngleEditDialog}
|
||||||
imageUrl={originalImageUrl}
|
onOpenChange={setShowAngleEditDialog}
|
||||||
onComplete={handleAngleEditComplete}
|
imageUrl={originalImageUrl}
|
||||||
/>
|
onComplete={handleAngleEditComplete}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user