From f1f7ceb1dec7f8c45489ca0744b77c4aa3096219 Mon Sep 17 00:00:00 2001 From: Allen Reinmeyer Date: Fri, 1 Sep 2017 02:08:55 -0400 Subject: [PATCH] breaking(Checkbox): callback with new checked value in onClick (#2014) breaking(Checkbox): callback with new checked value in onClick --- src/modules/Checkbox/Checkbox.js | 2 +- test/specs/modules/Checkbox/Checkbox-test.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/Checkbox/Checkbox.js b/src/modules/Checkbox/Checkbox.js index d8ec83c1b9..963db30392 100644 --- a/src/modules/Checkbox/Checkbox.js +++ b/src/modules/Checkbox/Checkbox.js @@ -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 }) diff --git a/test/specs/modules/Checkbox/Checkbox-test.js b/test/specs/modules/Checkbox/Checkbox-test.js index 2a42a62f1f..8fbc4c4c34 100644 --- a/test/specs/modules/Checkbox/Checkbox-test.js +++ b/test/specs/modules/Checkbox/Checkbox-test.js @@ -155,7 +155,7 @@ describe('Checkbox', () => { spy.should.have.been.calledOnce() spy.should.have.been.calledWithMatch({}, { ...expectProps, - checked: expectProps.checked, + checked: !expectProps.checked, indeterminate: expectProps.indeterminate, }) })