Skip to content

Commit

Permalink
fix(Checkbox): checkbox will update indeterminate state when in group
Browse files Browse the repository at this point in the history
  • Loading branch information
byeval committed Aug 15, 2019
1 parent 00bbfe6 commit 8b9582a
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/checkbox/checkbox.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ class Checkbox extends UIState {
),
});
}

this.disabled =
nextProps.disabled ||
('disabled' in nextContext && nextContext.disabled);
Expand All @@ -147,13 +148,14 @@ class Checkbox extends UIState {
checked: nextProps.checked,
});
}
if ('indeterminate' in nextProps) {
this.setState({
indeterminate: nextProps.indeterminate,
});
}
this.disabled = nextProps.disabled;
}

if ('indeterminate' in nextProps) {
this.setState({
indeterminate: nextProps.indeterminate,
});
}
}
shouldComponentUpdate(nextProps, nextState, nextContext) {
const { shallowEqual } = obj;
Expand Down

0 comments on commit 8b9582a

Please sign in to comment.