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

[Chip] deleteIcon has role set to presentation #19468

Closed
2 tasks done
shiraze opened this issue Jan 29, 2020 · 3 comments
Closed
2 tasks done

[Chip] deleteIcon has role set to presentation #19468

shiraze opened this issue Jan 29, 2020 · 3 comments
Labels
accessibility a11y component: chip This is the name of the generic UI component, not the React module! discussion

Comments

@shiraze
Copy link

shiraze commented Jan 29, 2020

The element that relates to the delete icon in Chip elements when the onDelete prop is set has role set to "presentation".
As this element performs an action, and there isn't any way to set an aria-label on the SVG, this seems to break accessibility rules.
https://www.w3.org/TR/wai-aria-1.0/roles#presentation

  • The issue is present in the latest release.
  • I have searched the issues of this repository and believe that this is not a duplicate.

Current Behavior 😯

Automation tools that attempt to detect the delete icon (in order to click it, for example), need to detect the MuiChip-deleteIcon css class.
Accessibility tools don't complain about the icon being "inaccessible" because it has the "presentation" role set
Screen readers don't detect the delete icon (but do detect the chip itself)

delete button is "invisible" to screen readers.

Expected Behavior 🤔

Screen readers should read out the delete button when selected.
Automation tools should be able to select the delete icon by an aria-label that describes what the button does

Steps to Reproduce 🕹

https://codesandbox.io/s/confident-solomon-e0v8o

Steps:

  1. Turn on a screen reader (e.g. Narrator on Windows)
  2. Note that screen reader detect chip text
  3. Screen reader does not detect delete button

Context 🔦

I need a fully accessible site, where any item that can be interacted with can be detected by visually impaired users.

Your Environment 🌎

Tech Version
Material-UI v4.8.2
React v16.12.0
Browser Chrome
TypeScript
etc.
@eps1lon
Copy link
Member

eps1lon commented Jan 29, 2020

We hide it via role="presentation" because it does not get an accessible name or is is focusable or in tab order etc. Chips can be deleted by clicking the tiny icon. For users that rely on the keyboard the Delete and Escape keys can be used.

We have a dedicated accessibility section in our docs: https://material-ui.com/components/chips/#accessibility

It would be nice to put the icon in the a11y tree by using a proper button but this requires a proposal for the design of the button with regards to Material design. As far as we can tell the icon isn't a separate button with regards to Material design.

We would also need to fix integration with the Autocomplete which reaches into implementation details of the Chip (#18271 for more context).

@eps1lon eps1lon added accessibility a11y component: chip This is the name of the generic UI component, not the React module! discussion labels Jan 29, 2020
@oliviertassinari oliviertassinari changed the title deleteIcon in Chip has role set to presentation [Chip] deleteIcon has role set to presentation Apr 27, 2021
@siriwatknp
Copy link
Member

I am closing this issue. The role="presentation" looks correct on icons. Let's focus on #20470

Copy link

This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue.
Now, if you have additional information related to this issue or things that could help future readers, feel free to leave a comment.

Note

@shiraze How did we do? Your experience with our support team matters to us. If you have a moment, please share your thoughts in this short Support Satisfaction survey.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accessibility a11y component: chip This is the name of the generic UI component, not the React module! discussion
Projects
None yet
Development

No branches or pull requests

3 participants