mirror of
https://github.com/Elysola/WebHooker.git
synced 2026-11-21 01:23:40 +00:00
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:
1 parent
628d5af5f3
commit
a8418c06d9
6 files changed
+58
-5
No files matched your search
@@ -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 {
|
||||
|
||||
@@ -258,8 +258,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();
|
||||
}
|
||||
|
||||
async function runTest(): Promise<void> {
|
||||
|
||||
Reference in new issue
Block a user