Skip to content

Commit 3d4efef

Browse files
committed
fix: array radio fields not switching value correctly closes #3141
1 parent 29e5cff commit 3d4efef

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

packages/vee-validate/src/useForm.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,14 @@ export function useForm<TValues extends Record<string, any> = Record<string, any
156156
}
157157

158158
setInPath(formValues, field as string, newValue);
159+
// multiple radio fields
160+
if (fieldInstance && Array.isArray(fieldInstance)) {
161+
fieldInstance.forEach(fieldItem => {
162+
valuesByFid[fieldItem.fid] = newValue;
163+
});
164+
return;
165+
}
166+
159167
if (fieldInstance) {
160168
valuesByFid[fieldInstance.fid] = newValue;
161169
}

0 commit comments

Comments
 (0)