Skip to content

Close menu when the escape key is pressed while menu button holds focus #277

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

Merged
merged 7 commits into from
Jul 28, 2021

Conversation

corymharper
Copy link
Contributor

This pull request implements a new keyboard behavior wherein if the menu button is focused and the escape key is pressed, the menu is then closed. This allows someone to close the menu with the keyboard without actually navigating into it after a click.

Closes #276

@codecov
Copy link

codecov bot commented Jul 27, 2021

Codecov Report

Merging #277 (ea6c128) into master (7fb956b) will increase coverage by 0.23%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #277      +/-   ##
==========================================
+ Coverage   92.47%   92.70%   +0.23%     
==========================================
  Files           1        1              
  Lines          93       96       +3     
  Branches       29       30       +1     
==========================================
+ Hits           86       89       +3     
  Misses          7        7              
Impacted Files Coverage Δ
src/use-dropdown-menu.ts 92.70% <100.00%> (+0.23%) ⬆️

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 7fb956b...ea6c128. Read the comment docs.

Co-authored-by: Wes Cossick <WesCossick@users.noreply.github.com>
@WesCossick WesCossick merged commit 70926e6 into master Jul 28, 2021
@WesCossick WesCossick deleted the close-menu-on-escape branch July 28, 2021 21:18
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 closing menu with escape key while the menu button has focus
2 participants