Skip to content

Commit

Permalink
Merge pull request alibaba-fusion#1019 from xuhong/hotfix/fix_checkbo…
Browse files Browse the repository at this point in the history
…x_group_indeterminate

fix(Checkbox): checkbox will update indeterminate state when in group
  • Loading branch information
myronliu347 authored Aug 21, 2019
2 parents 1b09bed + 8b9582a commit 2376cc6
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 2376cc6

Please sign in to comment.