Skip to content

Commit

Permalink
fix(ToggleButton): fixes error when pressing enter
Browse files Browse the repository at this point in the history
  • Loading branch information
langz committed Mar 31, 2023
1 parent 33a8d16 commit 9597341
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -205,15 +205,15 @@ export default class ToggleButton extends React.PureComponent {
onKeyDownHandler = (event) => {
switch (keycode(event)) {
case 'enter':
this.onClickHandler(event)
this.onClickHandler({ event })
break
}
}

onKeyUpHandler = (event) => {
switch (keycode(event)) {
case 'enter':
this.onClickHandler(event)
this.onClickHandler({ event })
break
}
}
Expand All @@ -232,7 +232,7 @@ export default class ToggleButton extends React.PureComponent {
return
}

// else we change the checked sstate
// else we change the checked state
const checked = !this.state.checked
this.setState({
checked,
Expand Down

0 comments on commit 9597341

Please sign in to comment.