Opening traps focus and announces both title and description. Closing
- returns focus to the trigger. Use Dialog for ordinary tasks and forms;
- reserve Alert Dialog for a decision that requires explicit attention.
+ with Escape, the backdrop, or either action returns focus to the
+ trigger. Use Dialog for ordinary tasks and forms; reserve Alert Dialog
+ for a decision that requires explicit attention.
diff --git a/packages/dowel/src/components/alert-dialog/alert-dialog.test.tsx b/packages/dowel/src/components/alert-dialog/alert-dialog.test.tsx
index f200fef..58df6a1 100644
--- a/packages/dowel/src/components/alert-dialog/alert-dialog.test.tsx
+++ b/packages/dowel/src/components/alert-dialog/alert-dialog.test.tsx
@@ -55,6 +55,21 @@ describe("AlertDialog", () => {
expect(onConfirm).toHaveBeenCalledOnce();
});
+ it("dismisses on a backdrop click and returns focus", async () => {
+ render(