Menu is not closed when TAB is pressed
See original GitHub issuedownshift
version:1.22.1
node
version:null
npm
(oryarn
) version:5.5.1
Relevant code or config
What you did: Pressing TAB when isOpen
is true
What happened: It stays open when no input present. Alternatively, It’s closed when there’s an input component.
Problem description: Actually, I can fix this problem by calling closeMenu
on button onBlur
. This is just a question though: what are the expected behavior? For me personally, it should be closed when user pressed TAB while isOpen={true}
Suggested solution: 👆if it’s the exected solution
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:8 (5 by maintainers)
Top Results From Across the Web
Prevent dropdown closing on pressing Tab in Materialize CSS ...
Clicking in the dropdown form works fine. Press Tab and it'll close the menu. $(document).ready(function(){ ...
Read more >When i press Alt+Tab then esc, instead of closing the menu it
The Esc key does not close menus or tabs; To close tabs, press together the keys: Alt + F4; And to open the...
Read more >Option to not close menu when opening new tab
(1) In a new tab, type or paste about:config in the address bar and press Enter/Return. Click the button accepting the risk. (2)...
Read more >Browser window - Opera Help
If you've accidentally closed a tab or want to reactivate the most recently closed tab, right-click (Ctrl+click on Mac) a tab and select...
Read more >Use tab groups with your keyboard - Google Chrome Help
To move to tab selection, press Ctrl + Tab. To switch focus to a specific tab, press Ctrl + Back or Ctrl +...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
That would work.
You’d need to be careful just adding an onBlur. In the example https://codesandbox.io/s/zx1kj58npl, shift tabbing would certainly blur the button but you’d then have focused on the input so probably wouldn’t want to close the drop down.