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 987784e commit 4bb6561
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 @@ -178,7 +178,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 4bb6561

Please sign in to comment.