Skip to content

Commit

Permalink
fix(conform-react): auto update value for checkbox group
Browse files Browse the repository at this point in the history
  • Loading branch information
edmundhung committed Sep 17, 2024
1 parent f2c1e41 commit 7f1cbb3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/conform-react/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,8 @@ export function useForm<
'checked' in element &&
(element.type === 'checkbox' || element.type === 'radio')
) {
element.checked = get(defaultValue) === element.value;
element.checked =
getAll(defaultValue)?.includes(element.value) ?? false;
} else {
element.value = get(defaultValue) ?? '';
}
Expand Down

0 comments on commit 7f1cbb3

Please sign in to comment.