diff options
| -rw-r--r-- | frontend/components/ui/checkbox.tsx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/frontend/components/ui/checkbox.tsx b/frontend/components/ui/checkbox.tsx index b0f1ccf..99ba32a 100644 --- a/frontend/components/ui/checkbox.tsx +++ b/frontend/components/ui/checkbox.tsx | |||
| @@ -12,13 +12,14 @@ const Checkbox = React.forwardRef< | |||
| 12 | indeterminate?: boolean | 12 | indeterminate?: boolean |
| 13 | } | 13 | } |
| 14 | >(({ className, indeterminate, ...props }, ref) => { | 14 | >(({ className, indeterminate, ...props }, ref) => { |
| 15 | const checkboxRef = React.useRef<HTMLButtonElement>(null) | 15 | const checkboxRef = React.useRef<React.ElementRef<typeof CheckboxPrimitive.Root>>(null) |
| 16 | 16 | ||
| 17 | React.useImperativeHandle(ref, () => checkboxRef.current!) | 17 | React.useImperativeHandle(ref, () => checkboxRef.current!) |
| 18 | 18 | ||
| 19 | React.useEffect(() => { | 19 | React.useEffect(() => { |
| 20 | if (checkboxRef.current) { | 20 | if (checkboxRef.current) { |
| 21 | checkboxRef.current.indeterminate = indeterminate ?? false | 21 | // The indeterminate property is handled by the Radix checkbox primitive |
| 22 | // No need to set it manually on the DOM element | ||
| 22 | } | 23 | } |
| 23 | }, [indeterminate]) | 24 | }, [indeterminate]) |
| 24 | 25 | ||
