react-hook-form 7.55.0-next.3 → 7.55.0-next.4

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.
@@ -1502,11 +1502,6 @@ function createFormControl(props = {}) {
1502
1502
  e.persist && e.persist();
1503
1503
  }
1504
1504
  let fieldValues = cloneObject(_formValues);
1505
- if (_names.disabled.size) {
1506
- for (const name of _names.disabled) {
1507
- set(fieldValues, name, undefined);
1508
- }
1509
- }
1510
1505
  _subjects.state.next({
1511
1506
  isSubmitting: true,
1512
1507
  });
@@ -1518,6 +1513,11 @@ function createFormControl(props = {}) {
1518
1513
  else {
1519
1514
  await executeBuiltInValidation(_fields);
1520
1515
  }
1516
+ if (_names.disabled.size) {
1517
+ for (const name of _names.disabled) {
1518
+ set(fieldValues, name, undefined);
1519
+ }
1520
+ }
1521
1521
  unset(_formState.errors, 'root');
1522
1522
  if (isEmptyObject(_formState.errors)) {
1523
1523
  _subjects.state.next({