@aatulwork/customform-renderer 1.6.0 → 1.7.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,11 +1621,15 @@ var FormRenderer = ({
1621
1621
  if (onSubmit) {
1622
1622
  try {
1623
1623
  await onSubmit(transformedData);
1624
- if (onSuccess) {
1625
- onSuccess();
1626
- clearErrors();
1627
- reset(initialValues || {}, { keepErrors: false });
1628
- }
1624
+ clearErrors();
1625
+ reset(initialValues || {}, {
1626
+ keepErrors: false,
1627
+ keepDirty: false,
1628
+ keepTouched: false,
1629
+ keepIsSubmitted: false,
1630
+ keepSubmitCount: false
1631
+ });
1632
+ if (onSuccess) onSuccess();
1629
1633
  } catch (error) {
1630
1634
  console.error("Form submission error:", error);
1631
1635
  let errorMessage = "Form submission failed. Please try again.";