Skip to content

Commit

Permalink
breaking(Checkbox): callback with new checked value in onClick (#2014)
Browse files Browse the repository at this point in the history
breaking(Checkbox): callback with new checked value in onClick
  • Loading branch information
areinmeyer authored and Alexander Fedyashov committed Sep 11, 2017
1 parent a7a1f7b commit d95da85
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/modules/Checkbox/Checkbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ export default class Checkbox extends Component {

if (!this.canToggle()) return

_.invoke(this.props, 'onClick', e, { ...this.props, checked: !!checked, indeterminate: !!indeterminate })
_.invoke(this.props, 'onClick', e, { ...this.props, checked: !checked, indeterminate: !!indeterminate })
_.invoke(this.props, 'onChange', e, { ...this.props, checked: !checked, indeterminate: false })

this.trySetState({ checked: !checked, indeterminate: false })
Expand Down
2 changes: 1 addition & 1 deletion test/specs/modules/Checkbox/Checkbox-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ describe('Checkbox', () => {
spy.should.have.been.calledOnce()
spy.should.have.been.calledWithMatch({}, {
...expectProps,
checked: expectProps.checked,
checked: !expectProps.checked,
indeterminate: expectProps.indeterminate,
})
})
Expand Down

0 comments on commit d95da85

Please sign in to comment.