diff --git a/UNRELEASED.md b/UNRELEASED.md index c5395159e5d..4fc29749097 100644 --- a/UNRELEASED.md +++ b/UNRELEASED.md @@ -28,4 +28,6 @@ Use [the changelog guidelines](https://git.io/polaris-changelog-guidelines) to f ### Code quality +- Simplified logic in Checkbox component ([#1453](https://github.com/Shopify/polaris-react/pull/1453)) + ### Deprecations diff --git a/src/components/Checkbox/Checkbox.tsx b/src/components/Checkbox/Checkbox.tsx index 8eb68c05e29..2db1aa6d3c1 100644 --- a/src/components/Checkbox/Checkbox.tsx +++ b/src/components/Checkbox/Checkbox.tsx @@ -53,8 +53,8 @@ class Checkbox extends React.PureComponent { componentDidUpdate({disabled: prevDisabled}: Props) { if ( + prevDisabled === true && this.props.disabled && - !prevDisabled !== true && this.inputNode.current && this.inputNode.current.checked ) {