fix(editors): ignore accidental backdrop dismissal

Do not discard unsaved route or group edits when the user clicks outside the dialog. Preserve Escape, Cancel and explicit close, including popovers and confirmation dialogs stacked above the editor.
This commit is contained in:
翅膀 committed 2026-10-17 08:12:55 +08:00
1 parent 628d5af5f3
commit a8418c06d9
6 files changed
+58 -5

No files matched your search

+4 -1
View File
@@ -343,8 +343,11 @@ function close(): void {
emit("close");
}
// A click on the backdrop must not discard what has been typed so far.
const { isBackdropClose } = useBackdropGuard(() => props.open, ".editor-dialog");
function onOpenChange(open: boolean): void {
if (!open) close();
if (!open && !isBackdropClose()) close();
}
function save(): void {