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

Dropdown ariaLabel not handled correctly #7041

Closed
ConorWuertz opened this issue Nov 8, 2018 · 5 comments · Fixed by #7292
Closed

Dropdown ariaLabel not handled correctly #7041

ConorWuertz opened this issue Nov 8, 2018 · 5 comments · Fixed by #7292

Comments

@ConorWuertz
Copy link
Contributor

Environment Information

  • Package version(s): 6.47.0
    Also visible in the current source code in master

Actual behavior:

When we provide both a label and an ariaLabel prop to the Dropdown component, the rendered "listbox" role element includes the aria-label attribute and also contains an aria-labelledby attribute that refers to the label element.

Expected behavior:

The expected behavior in my opinion would be for there to be no aria-labelledby attribute in addition to the aria-label attribute if we include the ariaLabel prop. The problem here is that screen readers will ignore the aria-label if we have an aria-labelledby attribute as well. The current behavior makes it impossible to include a visual label and an ariaLabel and have the ariaLabel take precedence for screen readers.

Priorities and help requested:

Are you willing to submit a PR to fix? Yes

Requested priority: Normal

Products/sites affected: Microsoft Teams (Shifts app)

@kenotron
Copy link
Member

kenotron commented Nov 8, 2018

@betrue-final-final - would you mind confirming this is indeed the right behavior?
@ConorWuertz - would you mind submitting a PR for this? Feel free to combine this with the other a11y bug

@ConorWuertz
Copy link
Contributor Author

@betrue-final-final any feedback on this?

@betrue-final-final
Copy link
Member

If someone could describe what the proposal is in end user terms it would help, otherwise @cschlechty may be able to help with the proper code.

@ConorWuertz
Copy link
Contributor Author

Developers may want to provide a concise visual label for the Dropdown component. Combined with other visual elements on the screen, this might suffice to communicate the purpose of the Dropdown. But for visually impaired end users using the dropdown, that concise visual label may not provide enough information to fully communicate what the Dropdown is for. Currently, if we provide a visual label to the component, screen readers will read that label regardless of any provided ARIA label.

My proposal is that when developers provide an ARIA label to this component in addition to a regular, visual label, the component should honor the aria label and ensure that screen readers read the aria label instead of the visual label.

@msft-github-bot
Copy link
Contributor

🎉This issue was addressed in #7292, which has now been successfully released as [email protected].:tada:

Handy Links:

@microsoft microsoft locked as resolved and limited conversation to collaborators Aug 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants