Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The React implementation of the Modal component should support role="alertdialog" #5960

Closed
FrivalszkyP opened this issue Apr 28, 2020 · 2 comments · Fixed by #5955
Closed

Comments

@FrivalszkyP
Copy link
Contributor

Detailed description

WAI-ARIA 1.1 describes an alertdialog role. To quote:

Dialogs are most often used to prompt the user to enter or respond to information. A dialog that is designed to interrupt workflow is usually modal. See related alertdialog.

Carbon already supports the danger={true} prop which, in my opinion, should go hand in hand with an alert prop that changes the role of the modal from dialog to alertdialog.

When an alertdialog role is set, assistive technology can announce the contents of the dialog upon being displayed, much like the contents of a role="alert" element are announced. This is desirable for dialogs that should interrupt workflow (see the ARIA description above).

It is also important that the WAI-ARIA guidelines state that a role="alertdialog" element should be supplied with an aria-label or aria-labelledby attribute as well as an aria-describedby attribute. The former is already taken care of by the Modal component, but an aria-describedby attribute should be added for alertdialogs that should point to the body text of the modal (i.e. the element that contains the props.children).

@dakahn
Copy link
Contributor

dakahn commented Jul 21, 2020

Seems sound to me while referencing the APG here
https://www.w3.org/TR/wai-aria-practices-1.1/#dialog_modal

Transferred this from a bug report to an enhancement request.

@FrivalszkyP
Copy link
Contributor Author

Great! You can take a look at #5955 to see if it covers the issue.

@kodiakhq kodiakhq bot closed this as completed in #5955 Jul 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants