@rjsf/core 5.18.0 → 5.18.2

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/core.umd.js CHANGED
@@ -3174,11 +3174,11 @@
3174
3174
  /** Provides a function that can be used to programmatically submit the `Form` */
3175
3175
  this.submit = () => {
3176
3176
  if (this.formElement.current) {
3177
- this.formElement.current.dispatchEvent(
3178
- new CustomEvent("submit", {
3179
- cancelable: true
3180
- })
3181
- );
3177
+ const submitCustomEvent = new CustomEvent("submit", {
3178
+ cancelable: true
3179
+ });
3180
+ submitCustomEvent.preventDefault();
3181
+ this.formElement.current.dispatchEvent(submitCustomEvent);
3182
3182
  this.formElement.current.requestSubmit();
3183
3183
  }
3184
3184
  };
package/dist/index.esm.js CHANGED
@@ -3523,11 +3523,11 @@ var Form = class extends Component5 {
3523
3523
  /** Provides a function that can be used to programmatically submit the `Form` */
3524
3524
  this.submit = () => {
3525
3525
  if (this.formElement.current) {
3526
- this.formElement.current.dispatchEvent(
3527
- new CustomEvent("submit", {
3528
- cancelable: true
3529
- })
3530
- );
3526
+ const submitCustomEvent = new CustomEvent("submit", {
3527
+ cancelable: true
3528
+ });
3529
+ submitCustomEvent.preventDefault();
3530
+ this.formElement.current.dispatchEvent(submitCustomEvent);
3531
3531
  this.formElement.current.requestSubmit();
3532
3532
  }
3533
3533
  };