We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4bcc613 commit 3b3c713Copy full SHA for 3b3c713
components/Formsy/TiledCheckboxGroup.jsx
@@ -15,13 +15,15 @@ class TiledCheckboxGroup extends Component {
15
16
onChange(value) {
17
const index = this.state.curValue.indexOf(value)
18
+ let newValue = [...this.state.curValue]
19
if (index > -1) {
- this.state.curValue.splice(index, 1)
20
+ newValue.splice(index, 1)
21
} else {
- this.state.curValue.push(value)
22
+ newValue.push(value)
23
}
- this.props.setValue(this.state.curValue)
24
- this.props.onChange(this.props.name, this.state.curValue)
+ this.setState({ curValue: newValue })
25
+ this.props.setValue(newValue)
26
+ this.props.onChange(this.props.name, newValue)
27
28
29
getCheckMarkIconActive() {
0 commit comments