Skip to content

Commit

Permalink
[EnhancedButton] Fix onClick event being fired twice on "Enter Key" p…
Browse files Browse the repository at this point in the history
…ress (#9439)
  • Loading branch information
George Karagkiaouris authored and m2mathew committed Jan 9, 2018
1 parent 830fb32 commit 84c9bca
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions src/internal/EnhancedButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,6 @@ class EnhancedButton extends Component {

handleKeyDown = (event) => {
if (!this.props.disabled && !this.props.disableKeyboardFocus) {
if (keycode(event) === 'enter' && this.state.isKeyboardFocused) {
this.handleClick(event);
}
if (keycode(event) === 'esc' && this.state.isKeyboardFocused) {
this.removeKeyboardFocus(event);
}
Expand All @@ -201,11 +198,6 @@ class EnhancedButton extends Component {
};

handleKeyUp = (event) => {
if (!this.props.disabled && !this.props.disableKeyboardFocus) {
if (keycode(event) === 'space' && this.state.isKeyboardFocused) {
this.handleClick(event);
}
}
this.props.onKeyUp(event);
};

Expand Down

0 comments on commit 84c9bca

Please sign in to comment.