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

fix(MultiSelect): adds and updates list item aria, fixes type bug w/ itemToString #7889

Merged
merged 2 commits into from
Feb 25, 2021

Conversation

dakahn
Copy link
Contributor

@dakahn dakahn commented Feb 24, 2021

Closes #6840

The selected state of a MultiSelect option wasn't being read since aria-selected wasn't being appropriately applied (due to us not using Downshift's useMultipleSelection hook). The a11y-status-message was reading selectedItem as "undefined" due to a type error passing an object of multiple selected items to itemToString().

Changelog

New

  • adds an explicit aria-label for better cross browser/cross reader support and so we don't have to rely on Downshift's a11y-status-message div

Changed

  • updates itemToString to loop through multiple selections
  • pass config to getItemProps that checks and apply's aria-selected correctly for multiple items*

Testing / Reviewing

Using a screen reader (NVDA, VoiceOver, or JAWS) confirm that the SELECTED state of a list item is announced on selection and on focus

*we dont add aria-selected="false" to unselected list items as per recommendation seen here

@dakahn dakahn requested a review from a team as a code owner February 24, 2021 18:47
@dakahn dakahn mentioned this pull request Feb 24, 2021
60 tasks
@dakahn dakahn changed the title fix(MultiSelect): adds and updates screen list item aria, fixes type bug w/ itemToString fix(MultiSelect): adds and updates list item aria, fixes type bug w/ itemToString Feb 24, 2021
@netlify
Copy link

netlify bot commented Feb 24, 2021

Deploy preview for carbon-elements ready!

Built with commit a502474

https://deploy-preview-7889--carbon-elements.netlify.app

@netlify
Copy link

netlify bot commented Feb 24, 2021

Deploy preview for carbon-components-react ready!

Built without sensitive environment variables with commit a502474

https://deploy-preview-7889--carbon-components-react.netlify.app

Copy link
Contributor

@andreancardona andreancardona left a comment

Choose a reason for hiding this comment

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

🎉 yay!

@kodiakhq kodiakhq bot merged commit b633233 into carbon-design-system:master Feb 25, 2021
@dakahn dakahn mentioned this pull request Mar 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants