-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Communicate checked status to screenreaders when OptionItems are used…
… in ActionMenu (#2255) ## Summary: When OptionItems are used within an ActionMenu, they should have role="menuitemcheckbox" and use aria-checked instead of aria-selected Issue: WB-1659 ## Test plan: - Confirm that an ActionMenu with OptionItems communicates when an option item is selected (`?path=/story/packages-dropdown-actionmenu--with-option-items`) - rendered option items should have role="menuitemcheckbox" and aria-checked="true" - screenreaders communicate the checked status ## Screen Recording ### Before & After In the before videos, the selected option item in the menu is not communicated to the user using a screen reader. In the after videos, it is communicated (safari reads out "Checkmark", Chrome reads out "checked") #### Safari https://github.com/Khan/wonder-blocks/assets/14334617/114ac914-0ece-4e65-a886-987e8ba2f163 https://github.com/Khan/wonder-blocks/assets/14334617/b54486bb-ec8a-4fc0-a38b-1093267782ff #### Chrome https://github.com/Khan/wonder-blocks/assets/14334617/24dc0246-34a4-4c1f-a5d8-26386bb55619 https://github.com/Khan/wonder-blocks/assets/14334617/bfb849c7-6dab-44a5-8a0e-5b442b167796 Author: beaesguerra Reviewers: beaesguerra, jandrade Required Reviewers: Approved By: jandrade, jandrade Checks: ✅ Chromatic - Get results on regular PRs (ubuntu-latest, 20.x), ✅ codecov/project, ✅ Test (ubuntu-latest, 20.x, 2/2), ✅ Test (ubuntu-latest, 20.x, 1/2), ✅ Lint (ubuntu-latest, 20.x), ✅ Check build sizes (ubuntu-latest, 20.x), ✅ Chromatic - Build on regular PRs / chromatic (ubuntu-latest, 20.x), ✅ Publish npm snapshot (ubuntu-latest, 20.x), ✅ Check for .changeset entries for all changed files (ubuntu-latest, 20.x), ⏭️ Chromatic - Skip on Release PR (changesets), ✅ Prime node_modules cache for primary configuration (ubuntu-latest, 20.x), ✅ gerald, ⏭️ dependabot Pull Request URL: #2255
- Loading branch information
1 parent
371749e
commit f099cf8
Showing
11 changed files
with
451 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
"@khanacademy/wonder-blocks-clickable": patch | ||
"@khanacademy/wonder-blocks-dropdown": patch | ||
"@khanacademy/wonder-blocks-cell": minor | ||
--- | ||
|
||
Improves accessibility of the checked status on `OptionItem` components used | ||
within the `ActionMenu` component. The checked status is communicated to | ||
screenreaders by using a `menuitemcheckbox` role with the `aria-checked` | ||
attribute (instead of `aria-selected`). | ||
- `CellCore` (used by `CompactCell` and `DetailCell`) has a new optional | ||
prop for `aria-checked` | ||
- `ClickableRole` type now supports the `menuitemcheckbox` role | ||
- `OptionItem`'s `role` prop now also supports the `menuitemcheckbox` role |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.