Skip to content

Commit

Permalink
fix: checkbox, default value
Browse files Browse the repository at this point in the history
  • Loading branch information
rboixaderg committed Apr 22, 2024
1 parent fd8de59 commit 03b9566
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/guillo-gmi/components/input/checkbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ export const Checkbox = ({
const inputRef = useRef<HTMLInputElement>(null)
const [state, setState] = useState<boolean>(!!checked)

useEffect(() => {
if (state !== checked) {
setState(!!checked)
}
}, [checked])

useEffect(() => {
if (inputRef.current) {
inputRef.current.indeterminate = indeterminate
Expand Down

0 comments on commit 03b9566

Please sign in to comment.