Skip to content

Commit

Permalink
Update src/components/Button.js
Browse files Browse the repository at this point in the history
Co-authored-by: Rajat Parashar <[email protected]>
  • Loading branch information
ahmdshrif and parasharrajat authored Mar 11, 2022
1 parent aaaf19e commit ec9f64e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/Button.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ class Button extends Component {

// Setup and attach keypress handler for pressing the button with Enter key
this.unsubscribe = KeyboardShortcut.subscribe(shortcutConfig.shortcutKey, (e) => {
if (this.props.isDisabled || this.props.isLoading || !e || e.target.nodeName === 'textarea') {
if (this.props.isDisabled || this.props.isLoading || (e && e.target.nodeName === 'textarea')) {
return;
}
this.props.onPress();
Expand Down

0 comments on commit ec9f64e

Please sign in to comment.