-
Notifications
You must be signed in to change notification settings - Fork 10
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
[WB-1799] Refactor WB Dropdown to use role="combobox" #2442
Conversation
## Summary: Addreses an issue in WB dropdowns where we were using the `button` role in the opener, which was causing issues with screen readers. This change updates the role to `combobox` that is more appropriate for the dropdown opener. Issue: https://khanacademy.atlassian.net/browse/WB-1671 ## Test plan: Navigate to the dropdowns in the Storybook and verify that the role of the opener is `combobox`. More details TBD Author: jandrade Reviewers: beaesguerra, marcysutton, jandrade, #wonder-blocks Required Reviewers: Approved By: beaesguerra Checks: ⌛ Test / Test (ubuntu-latest, 20.x, 2/2), ⌛ Lint / Lint (ubuntu-latest, 20.x), ⌛ Test / Test (ubuntu-latest, 20.x, 1/2), ⌛ Check build sizes (ubuntu-latest, 20.x), ✅ Publish npm snapshot (ubuntu-latest, 20.x), ⌛ Chromatic - Build on regular PRs / chromatic (ubuntu-latest, 20.x), ✅ Check for .changeset entries for all changed files (ubuntu-latest, 20.x), ✅ Prime node_modules cache for primary configuration (ubuntu-latest, 20.x), ⏭️ Chromatic - Skip on Release PR (changesets), ✅ gerald, ⏭️ dependabot Pull Request URL: #2345
…2420) In working on [WB-1799](https://khanacademy.atlassian.net/browse/WB-1799) for SingleSelect, I found a bunch of [disabled tests](https://khanacademy.atlassian.net/browse/FEI-5533) that I started fixing to ensure keyboard interactions work. Fixing these tests required changes to Clickable, which is used in WB Dropdowns. Issue: https://khanacademy.atlassian.net/browse/FEI-6114 PR highlights: 1. Re-enables some keyboard tests that were disabled with `userEvent@14` 2. Exposes a centralized `keys` object in `wonder-blocks-core` for use in `wonder-blocks-clickable`, `wonder-blocks-dropdown`, and any other modules that need it. 1. Note: userEvent passes the literal key code string back, i.e. `Space` or `space`. I lower-cased the key names to make sure they match in the code. We could use linting to enforce this instead... I'm open to suggestions. 3. Keeps two tests for SingleSelect disabled: 1. "It should find and select an item using the keyboard": fixing this one broke other tests (the dropdown isn't open before typing so refs aren't populated, but explicitly opening it made filtering tests fail). 2. "It should change the number of options after using the search filter" (Live Region test): this one fails for me when I enable it. I'll plan to revisit it as part of the Announcer implementation. ## Test Plan Run the tests using `yarn test`. There is one pre-existing lint failure for me locally in `expect-render-error.d.ts`, but it seems unrelated to these changes. [WB-1799]: https://khanacademy.atlassian.net/browse/WB-1799?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ Author: marcysutton Reviewers: kevinb-khan, beaesguerra, marcysutton Required Reviewers: Approved By: kevinb-khan, beaesguerra Checks: ✅ Chromatic - Get results on regular PRs (ubuntu-latest, 20.x), ✅ Test / Test (ubuntu-latest, 20.x, 2/2), ✅ Test / Test (ubuntu-latest, 20.x, 1/2), ✅ Lint / Lint (ubuntu-latest, 20.x), ✅ Check build sizes (ubuntu-latest, 20.x), ✅ Chromatic - Build on regular PRs / chromatic (ubuntu-latest, 20.x), ⏭️ Chromatic - Skip on Release PR (changesets), ⏹️ [cancelled] Chromatic - Get results on regular PRs, ✅ Publish npm snapshot (ubuntu-latest, 20.x), ✅ Prime node_modules cache for primary configuration (ubuntu-latest, 20.x), ✅ Check for .changeset entries for all changed files (ubuntu-latest, 20.x), ⏹️ [cancelled] Test, ⏹️ [cancelled] Lint, ⏹️ [cancelled] Check build sizes, ✅ gerald, ⏹️ [cancelled] Chromatic - Build on regular PRs / chromatic (ubuntu-latest, 20.x), ⏹️ [cancelled] Publish npm snapshot (ubuntu-latest, 20.x), ⏹️ [cancelled] Prime node_modules cache for primary configuration (ubuntu-latest, 20.x), ⏭️ Chromatic - Skip on Release PR (changesets), ⏹️ [cancelled] Check for .changeset entries for all changed files (ubuntu-latest, 20.x), ✅ gerald, ✅ Chromatic - Get results on regular PRs (ubuntu-latest, 20.x), ✅ Lint / Lint (ubuntu-latest, 20.x), ✅ Test / Test (ubuntu-latest, 20.x, 2/2), ✅ Test / Test (ubuntu-latest, 20.x, 1/2), ✅ Check build sizes (ubuntu-latest, 20.x), ✅ Publish npm snapshot (ubuntu-latest, 20.x), ✅ Chromatic - Build on regular PRs / chromatic (ubuntu-latest, 20.x), ✅ Prime node_modules cache for primary configuration (ubuntu-latest, 20.x), ⏭️ Chromatic - Skip on Release PR (changesets), ⌛ undefined Pull Request URL: #2420
…' into feature/dropdown-combobox
🦋 Changeset detectedLatest commit: 232fc10 The changes in this PR will be included in the next version bump. This PR includes changesets to release 27 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Size Change: +109 B (+0.11%) Total Size: 98.3 kB
ℹ️ View Unchanged
|
A new build was pushed to Chromatic! 🚀https://5e1bf4b385e3fb0020b7073c-sjpomxequm.chromatic.com/ Chromatic results:
|
GeraldRequired Reviewers
Don't want to be involved in this pull request? Comment |
npm Snapshot: Published🎉 Good news!! We've packaged up the latest commit from this PR (134901d) and published all packages with changesets to npm. You can install the packages in webapp by running: ./services/static/dev/tools/deploy_wonder_blocks.js --tag="PR2442" Packages can also be installed manually by running: yarn add @khanacademy/wonder-blocks-<package-name>@PR2442 |
…' into feature/dropdown-combobox
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2442 +/- ##
============================
============================
Continue to review full report in Codecov by Sentry.
|
The changes to WB Dropdown for
role="combobox"
were merged into a deploy branch. Now that other breaking changes to WB Dropdown have been released, I am ready to merge the combobox changes to main.This branch also includes automated test fixes for Dropdown keyboard support!
Issue: https://khanacademy.atlassian.net/browse/WB-1799
Original approved PRs:
combobox
role in all openers #2345