Skip to content

Commit 92737fd

Browse files
committed
fix: setValues setting array as field
fixes #105
1 parent b8dd18b commit 92737fd

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

packages/preact/src/methods/setValues.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ export function setValues<
125125
const compoundPath = prevPath ? `${prevPath}.${path}` : path;
126126

127127
// Set value of fields
128-
if (!value || typeof value !== 'object' || Array.isArray(value)) {
128+
if (!value || typeof value !== 'object' || !Array.isArray(value)) {
129129
setValue(form, compoundPath as FieldPath<TFieldValues>, value, {
130130
...options,
131131
shouldValidate: false,

packages/qwik/src/methods/setValues.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ export function setValues<
123123
const compoundPath = prevPath ? `${prevPath}.${path}` : path;
124124

125125
// Set value of fields
126-
if (!value || typeof value !== 'object' || Array.isArray(value)) {
126+
if (!value || typeof value !== 'object' || !Array.isArray(value)) {
127127
setValue(form, compoundPath as FieldPath<TFieldValues>, value, {
128128
...options,
129129
shouldValidate: false,

packages/react/src/methods/setValues.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ export function setValues<
125125
const compoundPath = prevPath ? `${prevPath}.${path}` : path;
126126

127127
// Set value of fields
128-
if (!value || typeof value !== 'object' || Array.isArray(value)) {
128+
if (!value || typeof value !== 'object' || !Array.isArray(value)) {
129129
setValue(form, compoundPath as FieldPath<TFieldValues>, value, {
130130
...options,
131131
shouldValidate: false,

packages/solid/src/methods/setValues.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ export function setValues<
125125
const compoundPath = prevPath ? `${prevPath}.${path}` : path;
126126

127127
// Set value of fields
128-
if (!value || typeof value !== 'object' || Array.isArray(value)) {
128+
if (!value || typeof value !== 'object' || !Array.isArray(value)) {
129129
setValue(form, compoundPath as FieldPath<TFieldValues>, value, {
130130
...options,
131131
shouldValidate: false,

0 commit comments

Comments
 (0)