-
Notifications
You must be signed in to change notification settings - Fork 217
Closed
Description
Describe the issue
It isn't possible to create an accessible dialog/modal using react-overlays.
Why is it an issue?
However, adding role="dialog" alone is not sufficient to make a dialog accessible. Additionally, the following needs to be done:
- The dialog must be properly labeled
The current implementation does not allow for additional ARIA props:
Lines 36 to 43 in 6a56f30
| export interface RenderModalDialogProps { | |
| style: React.CSSProperties | undefined; | |
| className: string | undefined; | |
| tabIndex: number; | |
| role: string; | |
| ref: React.RefCallback<Element>; | |
| 'aria-modal': boolean | undefined; | |
| } |
Expected implementation
These two attributes should be added to enable consumers to adhere to the guideline:
aria-labelledby: reference the ID of an element within the dialog that labels it, i.e. a heading elementaria-label: simple label of the dialog
Optional:
aria-describedby: reference the ID of an element within the dialog that describes it
Additional context
Consumers will not be able to get a 100% rating using accessibility checking tools, e.g. this is how axe DevTools flags the issue:
Metadata
Metadata
Assignees
Labels
No labels
