Commit 16d08f9
committed
fix: allow "role=alertdialog" to be closed on escape
This assumption was based on the description of https://github.com/edenspiekermann/a11y-dialog#usage-as-a-modal.
But reading the spec, I don't find a reference to prevent alertdialog dismiss with the `Esc` key. Actually the aria example is dismissable by escape key
https://www.w3.org/TR/wai-aria-practices-1.1/examples/dialog-modal/alertdialog.html
That being said, the backdrop click is still prevented with the role "alertdialog" because the spec also says that "keyboard and mouse interactions only operate within the dialog." and currently our backdrop is outside the dialgoRoot element (although) it's not invalid to move it inside (never tested it) - so this requires further thought1 parent 7719aac commit 16d08f9
1 file changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| |||
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
131 | | - | |
| 131 | + | |
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
| |||
0 commit comments