Why a11y-dialog claims that HTML <dialog> does not work with role="alertdialog" ?
rafalm-cyber opened this issue · 2 comments
- In here: https://a11y-dialog.netlify.app/ why there is added this: ,,Supports alert dialogs as per the WAI-ARIA specifications"
- In here: https://a11y-dialog.netlify.app/further-reading/dialog-element/#remaining-caveats why there is added this: ,,The alert dialog pattern (role="alertdialog") does not work with the element."
In Dialog Pattern and Alert Dialog Pattern there is no information that suggest that for role="alertdialog" we should prevent from closing dialog (modal) by ESC key. Opposite, in Keyboard Interaction section there is this: ,,Escape: Closes the dialog" same for alertdialog. Even more, in their exmaple for alert dialog they have option to close with ESC key: https://www.w3.org/WAI/ARIA/apg/patterns/alertdialog/examples/alertdialog/ .Even more, source that i trust tells that it can be done: https://web.dev/learn/html/dialog#aria_roles
This is important because you library claims that one of the most imporant reasons to use it is that HTML does not work with alertdialog and your library does.
Hello,
Thank you for opening an issue about this. You’re right, it seems that there is nothing in the Alert Dialog pattern (or its associated example) that explicitly forbids the ESC key from closing the dialog.
Regarding whether the <dialog>
element supports role="alertdialog"
, it didn’t use to in earlier iterations. It has come a long way since then and may be in a better shape now. I could remove that caveat from the documentation since it seems that it would work fine.
I’ll see if I can clarify things up in the documentation.
(Side note: web.dev is not always a source of truth when it comes to accessibility. They have/had a lot of incorrect or subpar information about this in the past.)
Done in #744.