material-web
material-web copied to clipboard
Dialogs should not assume to be alerts
the mwc-dialog component currently hard codes:
role="alertdialog"aria-describedby="content"
This only makes sense for dialogs that meet the extra qualifications for an ARIA alert, but most dialogs do not and the component is much more versatile than that.
I recommend making the following changes:
- Give the implementer the choice between roles
dialogoralertdialog, and the default should bedialogto be least intrusive to assistive technology - Set
aria-describedbyto all contents only when the role isalertdialogas the contents can be assumed to be concise - For the
dialogrole, give the implementer some control overaria-describedby, and omit it by default to be least disruptive to assistive technology
We need to update the default role to dialog, thanks for capturing this!
Fixed in M3, dialog's are dialog role by default and can be set to an alertdialog with the type="alert" attribute