react-hook-form 7.49.1 → 7.49.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.mjs
CHANGED
@@ -1656,7 +1656,7 @@ function createFormControl(props = {}, flushRootRender) {
|
|
1656
1656
|
const output = {
|
1657
1657
|
name,
|
1658
1658
|
};
|
1659
|
-
const disabledField = get(_fields, name) && get(_fields, name)._f.disabled;
|
1659
|
+
const disabledField = !!(get(_fields, name) && get(_fields, name)._f.disabled);
|
1660
1660
|
if (!isBlurEvent || shouldDirty) {
|
1661
1661
|
if (_proxyFormState.isDirty) {
|
1662
1662
|
isPreviousDirty = _formState.isDirty;
|
@@ -1664,7 +1664,7 @@ function createFormControl(props = {}, flushRootRender) {
|
|
1664
1664
|
shouldUpdateField = isPreviousDirty !== output.isDirty;
|
1665
1665
|
}
|
1666
1666
|
const isCurrentFieldPristine = disabledField || deepEqual(get(_defaultValues, name), fieldValue);
|
1667
|
-
isPreviousDirty = !disabledField && get(_formState.dirtyFields, name);
|
1667
|
+
isPreviousDirty = !!(!disabledField && get(_formState.dirtyFields, name));
|
1668
1668
|
isCurrentFieldPristine || disabledField
|
1669
1669
|
? unset(_formState.dirtyFields, name)
|
1670
1670
|
: set(_formState.dirtyFields, name, true);
|
@@ -2093,6 +2093,7 @@ function createFormControl(props = {}, flushRootRender) {
|
|
2093
2093
|
field,
|
2094
2094
|
disabled: options.disabled,
|
2095
2095
|
name,
|
2096
|
+
value: options.value,
|
2096
2097
|
});
|
2097
2098
|
}
|
2098
2099
|
else {
|