Skip to content

Commit

Permalink
πŸ› fix(formState, disabled): infer controlled disabled form state (#11361
Browse files Browse the repository at this point in the history
)

Closes: #11360
  • Loading branch information
Moshyfawn committed Jan 4, 2024
1 parent dab35e1 commit e6a5b1a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/logic/createFormControl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export function createFormControl<
touchedFields: {},
dirtyFields: {},
errors: _options.errors || {},
disabled: false,
disabled: _options.disabled || false,
};
let _fields: FieldRefs = {};
let _defaultValues =
Expand Down
2 changes: 1 addition & 1 deletion src/useForm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export function useForm<
dirtyFields: {},
touchedFields: {},
errors: props.errors || {},
disabled: false,
disabled: props.disabled || false,
defaultValues: isFunction(props.defaultValues)
? undefined
: props.defaultValues,
Expand Down

0 comments on commit e6a5b1a

Please sign in to comment.