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

feat: update useSelect to the ARIA 1.2 pattern #1402

Closed
wants to merge 1 commit into from

Conversation

silviuaavram
Copy link
Collaborator

@silviuaavram silviuaavram commented Aug 21, 2022

What:

BREAKING CHANGE: Migrates the useSelect hook to support the ARIA 1.2 pattern for single select combobox.

Closes #1365

The PR includes breaking changes, for both how useSelect works to the API it exposes. There are not that many changes that impact consumers, but all are documented in the migration guide.

Why:

How:

Checklist:

Changes to be performed:

  • Focus stays on the toggle button all the time.
  • aria-selected on the selected item, not highlighted item.
  • rest of aria attributes updated.
  • home and end open the menu.
  • select with tab.
  • PageUp and PageDown support.
  • Alt + ArrowUp and Alt + ArrowDown support.
  • useCombobox ArrowUp/ArrowDown when opening the menu highlight selected option if any, not +/- 1 offset.
  • remove circular navigation prop.

ToDo List:

  • Update unit tests.
  • update state change types.
  • update ts change types
  • update userEvent and tests to use new async API.
  • update reducer.
  • update useSelect.
  • update documentation.
  • update docsite with new version.
  • update sandbox examples with new version.
  • create migration guide.

Final checklist.

  • Documentation
  • Tests
  • TypeScript Types
  • Flow Types
  • Ready to be merged

@codecov-commenter
Copy link

codecov-commenter commented Sep 3, 2022

Codecov Report

Base: 100.00% // Head: 100.00% // No change to project coverage 👍

Coverage data is based on head (3bff9d5) compared to base (78ce9e9).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff            @@
##            master     #1402   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           18        18           
  Lines         1693      1664   -29     
  Branches       490       494    +4     
=========================================
- Hits          1693      1664   -29     
Impacted Files Coverage Δ
src/hooks/reducer.js 100.00% <ø> (ø)
src/hooks/useSelect/utils.ts 100.00% <ø> (ø)
src/hooks/testUtils.js 100.00% <100.00%> (ø)
src/hooks/useCombobox/testUtils.js 100.00% <100.00%> (ø)
src/hooks/useMultipleSelection/testUtils.js 100.00% <100.00%> (ø)
src/hooks/useSelect/index.js 100.00% <100.00%> (ø)
src/hooks/useSelect/reducer.js 100.00% <100.00%> (ø)
src/hooks/useSelect/testUtils.js 100.00% <100.00%> (ø)
src/hooks/utils.js 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@silviuaavram silviuaavram force-pushed the feat/select-aria-1.2 branch 3 times, most recently from 76bdef5 to 3bff9d5 Compare September 23, 2022 12:54
@punkpeye
Copy link

punkpeye commented Oct 3, 2022

What's the ETA for this landing?

@silviuaavram
Copy link
Collaborator Author

I plan to release this with 1.2 combobox, in a v7 release. Should land next week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Aria 1.2 support for useSelect
3 participants