fix(dialog): prevent dialogs from closing on overlay click
Add onInteractOutside handler to DialogContent to prevent accidental dialog closure when users click on the overlay/backdrop. This prevents data loss in forms and improves user experience across all 11 dialog components in the application. Users can still close dialogs using: - Close button (X) in the top-right corner - Cancel/Close buttons within the dialog - ESC key
This commit is contained in:
@@ -59,6 +59,10 @@ const DialogContent = React.forwardRef<
|
|||||||
zIndexMap[zIndex],
|
zIndexMap[zIndex],
|
||||||
className,
|
className,
|
||||||
)}
|
)}
|
||||||
|
onInteractOutside={(e) => {
|
||||||
|
// 防止点击遮罩层关闭对话框
|
||||||
|
e.preventDefault();
|
||||||
|
}}
|
||||||
{...props}
|
{...props}
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
|
|||||||
Reference in New Issue
Block a user