Skip to content

Commit

Permalink
fix: setValues setting array as feld
Browse files Browse the repository at this point in the history
  • Loading branch information
obedm503 committed Dec 22, 2024
1 parent b8dd18b commit 4e37bc3
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/preact/src/methods/setValues.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export function setValues<
const compoundPath = prevPath ? `${prevPath}.${path}` : path;

// Set value of fields
if (!value || typeof value !== 'object' || Array.isArray(value)) {
if (!value || typeof value !== 'object' || !Array.isArray(value)) {
setValue(form, compoundPath as FieldPath<TFieldValues>, value, {
...options,
shouldValidate: false,
Expand Down
2 changes: 1 addition & 1 deletion packages/qwik/src/methods/setValues.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export function setValues<
const compoundPath = prevPath ? `${prevPath}.${path}` : path;

// Set value of fields
if (!value || typeof value !== 'object' || Array.isArray(value)) {
if (!value || typeof value !== 'object' || !Array.isArray(value)) {
setValue(form, compoundPath as FieldPath<TFieldValues>, value, {
...options,
shouldValidate: false,
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/methods/setValues.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export function setValues<
const compoundPath = prevPath ? `${prevPath}.${path}` : path;

// Set value of fields
if (!value || typeof value !== 'object' || Array.isArray(value)) {
if (!value || typeof value !== 'object' || !Array.isArray(value)) {
setValue(form, compoundPath as FieldPath<TFieldValues>, value, {
...options,
shouldValidate: false,
Expand Down
2 changes: 1 addition & 1 deletion packages/solid/src/methods/setValues.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export function setValues<
const compoundPath = prevPath ? `${prevPath}.${path}` : path;

// Set value of fields
if (!value || typeof value !== 'object' || Array.isArray(value)) {
if (!value || typeof value !== 'object' || !Array.isArray(value)) {
setValue(form, compoundPath as FieldPath<TFieldValues>, value, {
...options,
shouldValidate: false,
Expand Down

0 comments on commit 4e37bc3

Please sign in to comment.