@bombillazo/rhf-plus 7.62.0-plus.4 → 7.62.0-plus.5

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.
@@ -1864,6 +1864,14 @@ function createFormControl(props = {}) {
1864
1864
  name: _state.mount ? name : undefined,
1865
1865
  values: cloneObject(_formValues),
1866
1866
  });
1867
+ // Trigger validation when shouldValidate is true
1868
+ // This ensures validation happens for all cases including:
1869
+ // - Field arrays
1870
+ // - Empty arrays
1871
+ // - Nested fields with array values
1872
+ if (options.shouldValidate) {
1873
+ trigger(name);
1874
+ }
1867
1875
  };
1868
1876
  const onChange = async (event) => {
1869
1877
  _state.mount = true;