From 5c163752ea72d2b84e9da660d5a8eab173358f2a Mon Sep 17 00:00:00 2001 From: Thibaut Sardan <33178835+Tbaut@users.noreply.github.com> Date: Thu, 14 Jul 2022 15:54:12 +0200 Subject: [PATCH] fix indeterminate state not reseting (#1112) --- packages/extension-ui/src/components/Checkbox.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/extension-ui/src/components/Checkbox.tsx b/packages/extension-ui/src/components/Checkbox.tsx index 28c22617..0e43af4c 100644 --- a/packages/extension-ui/src/components/Checkbox.tsx +++ b/packages/extension-ui/src/components/Checkbox.tsx @@ -21,8 +21,8 @@ function Checkbox ({ checked, className, indeterminate, label, onChange, onClick const checkboxRef = React.useRef(null); useEffect(() => { - if (indeterminate && checkboxRef.current) { - checkboxRef.current.indeterminate = true; + if (checkboxRef.current) { + checkboxRef.current.indeterminate = !!indeterminate; } }, [indeterminate]);