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

[Select][material-ui] Missing aria-multiselectable attribute on multiple Select component #38855

Merged
merged 7 commits into from
Sep 19, 2023
Merged

Conversation

gitstart
Copy link
Contributor

@gitstart gitstart commented Sep 7, 2023

Description

Missing aria-multiselectable attribute on multiple Select component

Steps to reproduce 🕹

Link to live example: https://codesandbox.io/s/nhnkzh?file=/Demo.tsx Steps:

  1. Tab to the select component and open the select menu using spacebar
  2. Use dev tools to inspect the menu
  3. Note the
      doesn't have the aria-multiselectable attribute set to true

Steps with JAWS screen reader:

  1. Tab to the select component
  2. Press spacebar to open the menu
  3. JAWS announces "tag listbox"
Current behavior 😯

The Select component is missing the aria-multiselectable attribute when using the multiple prop. Screen readers read the Select listbox as a standard listbox.

Expected behavior 🤔

If the listbox supports selection of more than one option, the element with role listbox has aria-multiselectable set to true. Otherwise, aria-multiselectable is either set to false or the default value of false is implied.

(Source)

With this attribute set to true - the JAWS screen reader will read the Select as "extended selection list box".

As stated on MDN Web Docs "The aria-multiselectable attribute is the way to inform assistive technology users that they may select more than one item from the current selectable items if they so choose."

Reference to JAWS documentation "Multiple Selection List Boxes": https://www.freedomscientific.com/SurfsUp/Forms.htm

See Example 2 Multi-Select Listbox on w3.org: https://www.w3.org/WAI/ARIA/apg/patterns/listbox/examples/listbox-rearrangeable/

Code example of working model: https://codepen.io/pen?&prefill_data_id=63e06758-0048-4774-a720-87cddb15147e

Context 🔦

When a screen reader user interacts with the Select component they are not informed that multiple options can be selected if the Select is using the multiple prop.

closes #38631


This code was written and reviewed by GitStart Community. Growing great engineers, one PR at a time.

@mui-bot
Copy link

mui-bot commented Sep 7, 2023

Netlify deploy preview

https://deploy-preview-38855--material-ui.netlify.app/

Bundle size report

Details of bundle changes (Toolpad)
Details of bundle changes

Generated by 🚫 dangerJS against 2c0c5ce

@gitstart gitstart marked this pull request as ready for review September 7, 2023 11:10
@gitstart
Copy link
Contributor Author

gitstart commented Sep 7, 2023

@mj12albert this PR is ready for review

@danilo-leal danilo-leal changed the title MUI-38631 - [Select][material-ui] Missing aria-multiselectable attribute on multiple Select component [Select][material-ui] Missing aria-multiselectable attribute on multiple Select component Sep 7, 2023
@danilo-leal danilo-leal added accessibility a11y component: select This is the name of the generic UI component, not the React module! package: material-ui Specific to @mui/material labels Sep 7, 2023
@zannager zannager requested a review from mj12albert September 7, 2023 14:20
Copy link
Member

@mj12albert mj12albert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's also add a simple test (I suppose here) to check for this ~

@gitstart
Copy link
Contributor Author

@mj12albert the test has been added, thanks for the review.

@gitstart gitstart requested a review from mj12albert September 18, 2023 12:30
Copy link
Member

@mj12albert mj12albert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good ~ 🙆‍♂️

@mj12albert mj12albert merged commit 5ae040f into mui:master Sep 19, 2023
6 checks passed
christophermorin pushed a commit to christophermorin/material-ui that referenced this pull request Sep 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accessibility a11y component: select This is the name of the generic UI component, not the React module! package: material-ui Specific to @mui/material
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Select][material-ui] Missing aria-multiselectable attribute on multiple Select component
4 participants