@bombillazo/rhf-plus 7.60.1-plus.0 → 7.62.0-plus.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.
@@ -41,7 +41,7 @@ function cloneObject(data) {
41
41
  }
42
42
  else if (!(isWeb && (data instanceof Blob || isFileListInstance)) &&
43
43
  (isArray || isObject(data))) {
44
- copy = isArray ? [] : {};
44
+ copy = isArray ? [] : Object.create(Object.getPrototypeOf(data));
45
45
  if (!isArray && !isPlainObject(data)) {
46
46
  copy = data;
47
47
  }
@@ -1770,8 +1770,10 @@ function createFormControl(props = {}) {
1770
1770
  const watched = isWatched(name, _names, isBlurEvent);
1771
1771
  set(_formValues, name, fieldValue);
1772
1772
  if (isBlurEvent) {
1773
- field._f.onBlur && field._f.onBlur(event);
1774
- delayErrorCallback && delayErrorCallback(0);
1773
+ if (!target || !target.readOnly) {
1774
+ field._f.onBlur && field._f.onBlur(event);
1775
+ delayErrorCallback && delayErrorCallback(0);
1776
+ }
1775
1777
  }
1776
1778
  else if (field._f.onChange) {
1777
1779
  field._f.onChange(event);
@@ -2266,6 +2268,7 @@ function createFormControl(props = {}) {
2266
2268
  ? _formState.isSubmitSuccessful
2267
2269
  : false,
2268
2270
  isSubmitting: false,
2271
+ defaultValues: _defaultValues,
2269
2272
  });
2270
2273
  };
2271
2274
  const reset = (formValues, keepStateOptions) => _reset(isFunction(formValues)