From 97b6ca3e90fd9f95869792e4e6b27ea236cc7932 Mon Sep 17 00:00:00 2001 From: TJ Egan Date: Thu, 25 May 2023 17:15:58 -0400 Subject: [PATCH] fix(Checkbox): fix issue with controlled indeterminate state (#13872) * fix(Checkbox): fix issue with controlled indeterminate state * refactor(Checkbox): remove test story --------- Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> --- packages/react/src/components/Checkbox/Checkbox.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/react/src/components/Checkbox/Checkbox.tsx b/packages/react/src/components/Checkbox/Checkbox.tsx index 79f2cb9b13dc..6bc628332899 100644 --- a/packages/react/src/components/Checkbox/Checkbox.tsx +++ b/packages/react/src/components/Checkbox/Checkbox.tsx @@ -160,8 +160,8 @@ const Checkbox = React.forwardRef( className={`${prefix}--checkbox`} id={id} ref={(el) => { - if (el && indeterminate) { - el.indeterminate = indeterminate; + if (el) { + el.indeterminate = indeterminate ?? false; } if (typeof ref === 'function') { ref(el);