diff --git a/apps/yaak-client/components/core/Dialog.tsx b/apps/yaak-client/components/core/Dialog.tsx index 5bbf29d8..c7962a1e 100644 --- a/apps/yaak-client/components/core/Dialog.tsx +++ b/apps/yaak-client/components/core/Dialog.tsx @@ -10,12 +10,13 @@ export interface DialogProps { children: ReactNode; open: boolean; onClose?: () => void; + /** Block dismissal from the backdrop, Escape key, and built-in close button. */ disableClose?: boolean; - disableBackdropClose?: boolean; title?: ReactNode; description?: ReactNode; className?: string; size?: DialogSize; + /** Hide the built-in close button without changing backdrop or Escape behavior. */ hideX?: boolean; noPadding?: boolean; noScroll?: boolean; @@ -29,7 +30,6 @@ export function Dialog({ open, onClose, disableClose, - disableBackdropClose, title, description, hideX, @@ -44,11 +44,7 @@ export function Dialog({ ); return ( - +
{/*Put close at the end so that it's the last thing to be tabbed to*/} - {!hideX && !disableClose && ( + {!disableClose && !hideX && (
resolve("cancel"), + disableClose: true, render: ({ hide }) => DivergedDialog({ remote, diff --git a/apps/yaak-client/lib/alert.ts b/apps/yaak-client/lib/alert.ts index 59af455d..4b41518b 100644 --- a/apps/yaak-client/lib/alert.ts +++ b/apps/yaak-client/lib/alert.ts @@ -14,9 +14,8 @@ export function showAlert({ id, title, body, size = "sm" }: AlertArgs) { showDialog({ id, title, - hideX: true, size, - disableBackdropClose: true, // Prevent accidental dismisses + disableClose: true, render: ({ hide }) => Alert({ onHide: hide, body }), }); } diff --git a/apps/yaak-client/lib/confirm.ts b/apps/yaak-client/lib/confirm.ts index aa670f17..00d0d5c4 100644 --- a/apps/yaak-client/lib/confirm.ts +++ b/apps/yaak-client/lib/confirm.ts @@ -18,9 +18,8 @@ export async function showConfirm({ return new Promise((onResult: ConfirmProps["onResult"]) => { showDialog({ ...extraProps, - hideX: true, size, - disableBackdropClose: true, // Prevent accidental dismisses + disableClose: true, render: ({ hide }) => Confirm({ onHide: hide, color, onResult, confirmText, requireTyping }), }); }); diff --git a/apps/yaak-client/lib/prompt-form.tsx b/apps/yaak-client/lib/prompt-form.tsx index 2ee125da..d109bb67 100644 --- a/apps/yaak-client/lib/prompt-form.tsx +++ b/apps/yaak-client/lib/prompt-form.tsx @@ -25,13 +25,8 @@ export async function showPromptForm({ id, title, description, - hideX: true, size: size ?? "sm", - disableBackdropClose: true, // Prevent accidental dismisses - onClose: () => { - // Click backdrop, close, or escape - resolve(null); - }, + disableClose: true, render: ({ hide }) => Prompt({ onCancel: () => {