Confirmation dialogs: when to block vs when to allow undo
Intro
Use a blocking confirmation dialog only for actions that are genuinely irreversible or have serious consequences. For anything user-deletable, a real Undo is almost always safer and less disruptive—see Undo demo.
For a robust, accessible dialog: Confirmation dialog micro-demo. For Undo best practices, see checklist & article.
Checklist: safer confirmation dialogs
- Only block with a dialog for truly irreversible or high-risk actions (e.g. permanent deletions, money, privacy risk).
- For almost all deletions or changes, prefer Undo (toast or snackbar with a real Undo button).
- Make Cancel always default focus, and Esc always cancels (no mouse required).
- Do not shift focus to the live region—keep focus logical (return to triggering button).
- Announce outcome via polite
aria-live, do not disrupt flow. - After confirm: move focus to next relevant action (next Delete, or Restore).
- See: confirmation dialog demo, Undo toast demo.