react-hook-form 7.61.0 → 7.62.0
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.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.mjs +6 -3
- package/dist/index.esm.mjs.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/dist/logic/createFormControl.d.ts.map +1 -1
- package/dist/react-server.esm.mjs +6 -3
- package/dist/react-server.esm.mjs.map +1 -1
- package/dist/types/form.d.ts +3 -35
- package/dist/types/form.d.ts.map +1 -1
- package/dist/types/utils.d.ts +1 -1
- package/dist/types/utils.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.mjs
CHANGED
@@ -40,7 +40,7 @@ function cloneObject(data) {
|
|
40
40
|
}
|
41
41
|
else if (!(isWeb && (data instanceof Blob || isFileListInstance)) &&
|
42
42
|
(isArray || isObject(data))) {
|
43
|
-
copy = isArray ? [] :
|
43
|
+
copy = isArray ? [] : Object.create(Object.getPrototypeOf(data));
|
44
44
|
if (!isArray && !isPlainObject(data)) {
|
45
45
|
copy = data;
|
46
46
|
}
|
@@ -1717,8 +1717,10 @@ function createFormControl(props = {}) {
|
|
1717
1717
|
const watched = isWatched(name, _names, isBlurEvent);
|
1718
1718
|
set(_formValues, name, fieldValue);
|
1719
1719
|
if (isBlurEvent) {
|
1720
|
-
|
1721
|
-
|
1720
|
+
if (!target || !target.readOnly) {
|
1721
|
+
field._f.onBlur && field._f.onBlur(event);
|
1722
|
+
delayErrorCallback && delayErrorCallback(0);
|
1723
|
+
}
|
1722
1724
|
}
|
1723
1725
|
else if (field._f.onChange) {
|
1724
1726
|
field._f.onChange(event);
|
@@ -2213,6 +2215,7 @@ function createFormControl(props = {}) {
|
|
2213
2215
|
? _formState.isSubmitSuccessful
|
2214
2216
|
: false,
|
2215
2217
|
isSubmitting: false,
|
2218
|
+
defaultValues: _defaultValues,
|
2216
2219
|
});
|
2217
2220
|
};
|
2218
2221
|
const reset = (formValues, keepStateOptions) => _reset(isFunction(formValues)
|