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 d187ec7 commit aa6253d
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 aa6253d

Please sign in to comment.