Sponsored Content
The Wayback Machine - https://web.archive.org/web/20210817024824/https://github.com/google/site-kit-wp/issues/345
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

Dialog Component Accessibility Issues #345

Closed
swissspidy opened this issue Jul 30, 2019 · 2 comments
Closed

Dialog Component Accessibility Issues #345

swissspidy opened this issue Jul 30, 2019 · 2 comments

Comments

@swissspidy
Copy link
Member

@swissspidy swissspidy commented Jul 30, 2019 •

Bug Description

The Dialog component uses role="alertdialog" and thus aria-labelledby and aria-describedby attributes. These contain the ID of the element that labels/describes the dialog: aria-labelledby="remove-module-dialog" and aria-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-dialog and remove-module-dialog-description IDs.

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 withInstanceId HOC from the @wordpress/compose package.

Second, the #remove-module-dialog-description element 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

  • The Dialog component should be implemented in a way that cannot introduce duplicate ID attributes on a page.
  • The Dialog component should only use aria-labelledby and aria-describedby if there are actually elements with the respective IDs that include respective content.

Implementation Brief

  • Wrap Dialog components with withInstanceId
  • Use instanceId to build unique instance-specific IDs for use with aria attributes
  • Only set aria attributes if the elements they reference aren't empty
  • Merge #1082

Changelog entry

  • Fix accessibility issues in dialog component with potentially duplicate IDs and invalid ARIA attributes.
@felixarntz
Copy link
Member

@felixarntz felixarntz commented Feb 14, 2020

IB ✅

@felixarntz felixarntz removed their assignment Feb 14, 2020
@felixarntz felixarntz added this to the Sprint 16 milestone Feb 14, 2020
@eclarke1 eclarke1 removed this from the Sprint 16 milestone Feb 19, 2020
@eclarke1 eclarke1 added this to the Sprint 17 milestone Feb 19, 2020
@felixarntz felixarntz assigned felixarntz and unassigned felixarntz Feb 21, 2020
@felixarntz felixarntz assigned aaemnnosttv and unassigned felixarntz Feb 21, 2020
@felixarntz felixarntz removed their assignment Feb 21, 2020
@tofumatt tofumatt self-assigned this Feb 24, 2020
@tofumatt
Copy link
Collaborator

@tofumatt tofumatt commented Feb 24, 2020

QA ✅

Tested this with NVDA and checked the output in browser. Works as expected when opening a dialog, thanks! 👍

@tofumatt tofumatt removed their assignment Feb 24, 2020
@felixarntz felixarntz closed this Feb 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
7 participants