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 (
|
||||
<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 gap-2">
|
||||
|
||||
@ -1752,14 +1752,16 @@ export function ImageAnnotator({ imageUrl, onConfirm, onCancel, initialResizeMod
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* 角度调整对话框 */}
|
||||
{/* 角度调整对话框 - 包裹在阻止事件冒泡的 div 中 */}
|
||||
{showAngleEditDialog && originalImageUrl && (
|
||||
<AngleEditDialog
|
||||
open={showAngleEditDialog}
|
||||
onOpenChange={setShowAngleEditDialog}
|
||||
imageUrl={originalImageUrl}
|
||||
onComplete={handleAngleEditComplete}
|
||||
/>
|
||||
<div onClick={(e) => e.stopPropagation()} onMouseDown={(e) => e.stopPropagation()}>
|
||||
<AngleEditDialog
|
||||
open={showAngleEditDialog}
|
||||
onOpenChange={setShowAngleEditDialog}
|
||||
imageUrl={originalImageUrl}
|
||||
onComplete={handleAngleEditComplete}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user