diff --git a/packages/react/src/components/InlineCheckbox/InlineCheckbox.js b/packages/react/src/components/InlineCheckbox/InlineCheckbox.js index 662ba416ef90..3d02d247b959 100644 --- a/packages/react/src/components/InlineCheckbox/InlineCheckbox.js +++ b/packages/react/src/components/InlineCheckbox/InlineCheckbox.js @@ -38,7 +38,7 @@ const InlineCheckbox = React.forwardRef(function InlineCheckbox( disabled, id, name, - onClick, + onClick: onClick ? onClickCheckBoxInput : onClick, onChange: (evt) => { onChange(evt.target.checked, id, evt); }, @@ -57,6 +57,14 @@ const InlineCheckbox = React.forwardRef(function InlineCheckbox( } }, [indeterminate]); + function onClickCheckBoxInput(evt) { + // If the previous "indeterminate" is true, change "checked" to false. If it is not undefined, we're working on `TableSelectAll` + if (indeterminate) { + evt.target.checked = false; + } + onClick(evt); + } + return (