-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Make font size dropdown more accessible. #33941
Make font size dropdown more accessible. #33941
Conversation
I believe this is mostly ready for review. This brings a good improvement for the font size component as well as support for other components that may use this custom select box. This PR was primarily created for the font size fixes but there were a couple components involved that needed adjusting. |
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.
The code change looks good to me and works well on my tests 👍
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.
Tested with VoiceOver/Safari and NVDA/Firefox and this is working really well ✅
…pdate/font-size-select-accessibility
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.
Thanks for the contribution @alexstine !
I was wondering if we should make this built in in the CustomSelectControl
component. There are other usages of this component (check font weight, etc...) and we could use the a11y enhancement for all of them. For example we could have something like:
const describedBy = `Currently selected ${ label?.toLowerCase() }: ${
selectedItem?.name
}`;
We could even have the new describedBy
prop and if not provided, use something like the above snippet. What do you think?
Tested with NVDA and chrome on Windows, works well. +1 for using it in the component and solving the translation. |
…pdate/font-size-select-accessibility
I made a few updates to the PR.
Please let me know if an issue is spotted. @ntsekouras Thanks for the suggestion. As you can see, I adapted your idea a bit, but I think it will work fine this way. |
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.
Thanks for your work on this @alexstine ! Great work 💯
This just needs the fixing of the linter issue. Maybe a better name to the var as well, but I don't consider this a blocker.
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.
Great work here, thanks! 💯
Description
The overall change in this pull request will allow screen readers to see the currently selected font size without having to open the menu. This message is communicated via aria-describedby. Since the aria-label overrides the button text, I had to provide a way for screen readers to see the currently selected font size value.
How has this been tested?
I tested this using NVDA, JAWS, and Voiceover. Browsers used include Firefox, Google Chrome, and Safari.
Screenshots
Types of changes
I guess you could consider this a Bug fix.
Checklist:
*.native.js
files for terms that need renaming or removal).