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

Implement extra keyboard controls #272

Merged
merged 12 commits into from
May 21, 2021
Merged

Conversation

corymharper
Copy link
Contributor

@corymharper corymharper commented May 20, 2021

This pull request implements all of the pertinent optional keyboard controls listed on this page: https://www.w3.org/TR/wai-aria-practices/#keyboard-interaction-12

Those include:

Space: It will now activate menu items and close the menu after activation
Printable characters (not including those that have some other function): Will move the focus to the first menu item whose label starts with the corresponding character

Closes #269

@codecov
Copy link

codecov bot commented May 20, 2021

Codecov Report

Merging #272 (4667844) into master (0ddd2f2) will increase coverage by 0.70%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #272      +/-   ##
==========================================
+ Coverage   91.76%   92.47%   +0.70%     
==========================================
  Files           1        1              
  Lines          85       93       +8     
  Branches       24       29       +5     
==========================================
+ Hits           78       86       +8     
  Misses          7        7              
Impacted Files Coverage Δ
src/use-dropdown-menu.ts 92.47% <100.00%> (+0.70%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0ddd2f2...4667844. Read the comment docs.

Copy link
Member

@WesCossick WesCossick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also update the PR description to describe in a little more detail what these optional keys do? So people don't have to dig through the documentation.

package.json Outdated Show resolved Hide resolved
corymharper and others added 2 commits May 21, 2021 10:37
Co-authored-by: Wes Cossick <WesCossick@users.noreply.github.com>
@corymharper corymharper dismissed WesCossick’s stale review May 21, 2021 16:18

Requested changes made

Co-authored-by: Wes Cossick <WesCossick@users.noreply.github.com>
@WesCossick WesCossick merged commit 7fb956b into master May 21, 2021
@WesCossick WesCossick deleted the extra-keyboard-controls branch May 21, 2021 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Support for Space along with Enter key in itemListener?
2 participants