Skip to content

Commit

Permalink
fix(ButtonDropdown): add close event when Escape key is pressed (#1634)…
Browse files Browse the repository at this point in the history
… (#1635)

fixes #1634
  • Loading branch information
ftonato authored and TheSharpieOne committed Oct 1, 2019
1 parent dc0b8ae commit 911d779
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Dropdown.js
Expand Up @@ -130,6 +130,8 @@ class Dropdown extends React.Component {
) {
this.toggle(e);
setTimeout(() => this.getMenuItems()[0].focus());
} else if (this.props.isOpen && e.which === keyCodes.esc) {
this.toggle(e);
}
}

Expand Down

0 comments on commit 911d779

Please sign in to comment.