Skip to content

ARIA role="dialog" must have an accessible label #964

@emmasax

Description

@emmasax

Describe the issue

It isn't possible to create an accessible dialog/modal using react-overlays.

Why is it an issue?

MDN - ARIA: dialog role

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:

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 element
  • aria-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:

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions