Dialog Component Accessibility Issues #345
Comments
|
IB |
6 tasks
|
QA Tested this with NVDA and checked the output in browser. Works as expected when opening a dialog, thanks! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment


Bug Description
The Dialog component uses
role="alertdialog"and thusaria-labelledbyandaria-describedbyattributes. These contain the ID of the element that labels/describes the dialog:aria-labelledby="remove-module-dialog"andaria-describedby="remove-module-dialog-description", respectively.Now, there are a couple of issues here:
First, these attributes are not necessarily unique on the page. When the component is used N times, there will be N elements with the same
remove-module-dialogandremove-module-dialog-descriptionIDs.This is the case on the settings screen, where "Reset Site Kit" and "Disconnect" both open dialogs.
An easy way to solve this would be to use the
withInstanceIdHOC from the@wordpress/composepackage.Second, the
#remove-module-dialog-descriptionelement is usually empty. Therefore there is no actual ARIA description for the dialog. Correct would be pointing to an element that contains a written sentence describing the dialog.Here's a good example: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-describedby_attribute
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
Dialogcomponent should be implemented in a way that cannot introduce duplicate ID attributes on a page.Dialogcomponent should only usearia-labelledbyandaria-describedbyif there are actually elements with the respective IDs that include respective content.Implementation Brief
withInstanceIdinstanceIdto build unique instance-specific IDs for use with aria attributesariaattributes if the elements they reference aren't emptyChangelog entry
The text was updated successfully, but these errors were encountered: