react-hook-form 7.51.1 → 7.51.3

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.
@@ -1598,11 +1598,16 @@ function createFormControl(props = {}) {
1598
1598
  };
1599
1599
  const _updateIsValidating = (names, isValidating) => {
1600
1600
  if (_proxyFormState.isValidating || _proxyFormState.validatingFields) {
1601
- (names || Array.from(_names.mount)).forEach((name) => name && set(_formState.validatingFields, name, !!isValidating));
1602
- _formState.isValidating = Object.values(_formState.validatingFields).some((val) => val);
1601
+ (names || Array.from(_names.mount)).forEach((name) => {
1602
+ if (name) {
1603
+ isValidating
1604
+ ? set(_formState.validatingFields, name, isValidating)
1605
+ : unset(_formState.validatingFields, name);
1606
+ }
1607
+ });
1603
1608
  _subjects.state.next({
1604
1609
  validatingFields: _formState.validatingFields,
1605
- isValidating: _formState.isValidating,
1610
+ isValidating: !isEmptyObject(_formState.validatingFields),
1606
1611
  });
1607
1612
  }
1608
1613
  };
@@ -1901,6 +1906,7 @@ function createFormControl(props = {}) {
1901
1906
  });
1902
1907
  };
1903
1908
  const onChange = async (event) => {
1909
+ _state.mount = true;
1904
1910
  const target = event.target;
1905
1911
  let name = target.name;
1906
1912
  let isFieldValueUpdated = true;