-
Notifications
You must be signed in to change notification settings - Fork 350
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] [BUGFIX] Update aria-label logic #1953
Conversation
Size Change: +1 B (0%) Total Size: 1.29 MB
ℹ️ View Unchanged
|
npm Snapshot: PublishedGood news!! We've packaged up the latest commit from this PR (f09317a) and published it to npm. You Example: yarn add @khanacademy/perseus@PR1953 If you are working in Khan Academy's webapp, you can run: ./dev/tools/bump_perseus_version.sh -t PR1953 |
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 following up with the WB team.
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## @khanacademy/[email protected] ### Patch Changes - [#1975](#1975) [`335615bab`](335615b) Thanks [@jeremywiebe](https://github.com/jeremywiebe)! - Make all types in `perseus-types.ts` originate from it (no longer import Mafs types) - [#1953](#1953) [`acd8bd566`](acd8bd5) Thanks [@daniellewhyte](https://github.com/daniellewhyte)! - [Dropdown] Change logic for aria-label ## @khanacademy/[email protected] ### Patch Changes - Updated dependencies \[[`335615bab`](335615b), [`acd8bd566`](acd8bd5)]: - @khanacademy/[email protected]
Summary:
This PR contains two fixes for the aria-label in the dropdown widget:
Follow up from Mark's comment on Add visible label and ARIA label to Dropdown widget #1845
This commit ensures that the visible label does not override the aria label.
Motivation: There may be additional info for the screen reader in the aria label that may not be in the visible label.
This changes also removes the aria-labelledby from the Dropdown which was causing the screen reader output to be garbled in Safari.
(" ")
for empty placeholder.Wonder Blocks adds a nbsp when an empty string is passed in as one of the option items. This does not work well with screen readers. When testing with Voice Over on Safari and Firefox, it reads out the space and the aria label as a series of characters (instead of words).
dropdown.aria.label.mov
The root cause for this should be fixed in Wonder Blocks and I’ve started a discussion with the WB team here (I haven't been able to find a solution in WB yet). Given that this bug exists on prod in webapp, it feels appropriate to go ahead and implement this fix in Perseus.
Issue: LIT-1476, LIT-1482
Test plan:
Test with the new Dropdown with empty placeholder story
fix.aria.label.safari.mov