@aatulwork/customform-renderer 1.7.0 → 1.9.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.js CHANGED
@@ -1621,14 +1621,17 @@ var FormRenderer = ({
1621
1621
  if (onSubmit) {
1622
1622
  try {
1623
1623
  await onSubmit(transformedData);
1624
- clearErrors();
1625
- reset(initialValues || {}, {
1624
+ const resetValues = initialValues || {};
1625
+ reset(resetValues, {
1626
1626
  keepErrors: false,
1627
1627
  keepDirty: false,
1628
1628
  keepTouched: false,
1629
1629
  keepIsSubmitted: false,
1630
1630
  keepSubmitCount: false
1631
1631
  });
1632
+ setTimeout(() => {
1633
+ clearErrors();
1634
+ }, 0);
1632
1635
  if (onSuccess) onSuccess();
1633
1636
  } catch (error) {
1634
1637
  console.error("Form submission error:", error);