sparksuite / react-accessible-dropdown-menu-hook

A simple Hook for creating fully accessible dropdown menus in React
http://sparksuite.github.io/react-accessible-dropdown-menu-hook
MIT License
112 stars 26 forks source link

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

Closed corymharper closed 3 years ago

corymharper commented 3 years ago

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[bot] commented 3 years ago

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%) :arrow_up:

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.