-
Notifications
You must be signed in to change notification settings - Fork 6.8k
fix(material/select): don't announce selected value multiple times #24831
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
Conversation
d29c328
to
bc44d03
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zarend can you take a look as well and potentially try this out with ChromeVox?
bc44d03
to
5144f43
Compare
Screen readers announce the selected value multiple times. NVDA e.g. reads "Favorite food Pizza Pizza combobox Pizza collapsed". 1. First, the Screen Reader (SR) reads the value of the label (see 1st `aria-labelledby`): "Favorite food" 2. SR reads the content of the combobox: "Pizza" 3. SR reads the value of the combobox (see 2nd `aria-labelledby`): "Pizza" 4. SR reads the content of the combobox again: "Pizza" To fix this, an `aria-hidden` attribute is added to the element containing the selected value. NVDA e.g. now reads "Favorite food Pizza combobox collapsed"
5144f43
to
8f4d839
Compare
The accessible name of the combobox shouldn't contain the dropdown value as well. This is not best practice. Same for the label tag, it's unnecessary since it only works for native html (select and input). The aria-owns lets the screen reader know that despite the element being lower on the DOM, it should be focused on it first before the element it owns. So this should be kept. My suggestion for the fix would be:
|
bump |
Closing in favor of #30374 which tries to stop adding the selected option as an |
Screen readers announce the selected value multiple times. NVDA e.g. reads "Favorite food Pizza Pizza combobox Pizza collapsed".
aria-labelledby
): "Favorite food"aria-owns
attribute): "Pizza"aria-labelledby
): "Pizza"To fix this, an
aria-hidden
attribute is added to the element containing the selected value. NVDA e.g. now reads "Favorite food Pizza combobox collapsed".Successfully tested with NVDA, JAWS, Narrator and the Screen Reader Chrome plugin.
Closes #24899