Skip to content

Commit

Permalink
馃悶 fix #11821 set value with disabled false before mount (#11880)
Browse files Browse the repository at this point in the history
* fix(11821): lodash get does not return defaultValue

When expression is evaluated as null the get method does not return defaultValue

* Update createFormControl.ts

---------

Co-authored-by: Beier (Bill) <bluebill1049@hotmail.com>
  • Loading branch information
erashu212 and bluebill1049 committed May 18, 2024
1 parent 52611a5 commit 2364d43
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/logic/createFormControl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -983,7 +983,7 @@ export function createFormControl<
fields,
value,
}) => {
if (isBoolean(disabled)) {
if ((isBoolean(disabled) && _state.mount) || !!disabled) {
const inputValue = disabled
? undefined
: isUndefined(value)
Expand Down

0 comments on commit 2364d43

Please sign in to comment.