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

Button dropdown does not close when Escape key is pressed #1634

Closed
schpet opened this issue Oct 1, 2019 · 3 comments · Fixed by #1635
Closed

Button dropdown does not close when Escape key is pressed #1634

schpet opened this issue Oct 1, 2019 · 3 comments · Fixed by #1635

Comments

@schpet
Copy link

schpet commented Oct 1, 2019

  • components: ButtonDropdown
  • reactstrap version reactstrap@8.0.1
  • import method webpack
  • react version react@16.8.6
  • bootstrap version bootstrap@4.3.1

What is happening?

dropdown is not closing on escape key

What should be happening?

dropdown should close on escape key

However, Bootstrap does add built-in support for most standard keyboard menu interactions, such as the ability to move through individual .dropdown-item elements using the cursor keys and close the menu with the ESC key.

https://getbootstrap.com/docs/4.3/components/dropdowns/#accessibility

Steps to reproduce issue

  1. click on a dropdown, opening it up
  2. press Esc key

Code

https://reactstrap.github.io/components/button-dropdown/

@TheSharpieOne
Copy link
Member

TheSharpieOne commented Oct 1, 2019

Looks like we only close on esc (and perform other keyboard actions such as arrow keys) when focus is within the menu (not the button). When focus is on the button/trigger, esc and other keyboard actions, such as arrow keys, need to still work.

@ftonato
Copy link
Contributor

ftonato commented Oct 1, 2019

Could I spend attention to this one?

@schpet
Copy link
Author

schpet commented Oct 1, 2019

whoa, awesome! really appreciate the fix folks 🙌🏻

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

Successfully merging a pull request may close this issue.

3 participants