Skip to content

Commit

Permalink
fix(Dropdown): enter key triggers onClick (#1232)
Browse files Browse the repository at this point in the history
Closes #1228
  • Loading branch information
simontong authored and TheSharpieOne committed Sep 24, 2018
1 parent 35b4dd7 commit f2528da
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ class Dropdown extends React.Component {

const container = this.getContainer();

if (e.which === keyCodes.space && this.props.isOpen && container !== e.target) {
if (e.which === keyCodes.space && keyCodes.enter && this.props.isOpen && container !== e.target) {
e.target.click();
}

Expand Down
1 change: 1 addition & 0 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ export const TransitionStatuses = {
export const keyCodes = {
esc: 27,
space: 32,
enter: 13,
tab: 9,
up: 38,
down: 40
Expand Down

0 comments on commit f2528da

Please sign in to comment.