Skip to content

Commit

Permalink
Disable onChange event if toggle button disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
NellyHaglund committed Apr 14, 2020
1 parent 343c661 commit c442be9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/togglebutton/ToggleButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export class ToggleButton extends Component {
}

toggle(e) {
if (this.props.onChange) {
if (!this.props.disabled && this.props.onChange) {
this.props.onChange({
originalEvent: e,
value: !this.props.checked,
Expand Down

0 comments on commit c442be9

Please sign in to comment.