Skip to content

Commit

Permalink
fix(toggle-small): only emit onChange on keyUp if it exists (#5931)
Browse files Browse the repository at this point in the history
  • Loading branch information
janhassel authored Apr 25, 2020
1 parent 6e02f68 commit 102a6fe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/react/src/components/ToggleSmall/ToggleSmall.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const ToggleSmall = ({
onKeyUp={evt => {
if (match(evt, keys.Enter)) {
input.checked = !input.checked;
onChange(evt);
onChange && onChange(evt);
onToggle(input.checked, id, evt);
}
}}
Expand Down

0 comments on commit 102a6fe

Please sign in to comment.