@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/index.js CHANGED
@@ -3429,11 +3429,11 @@ var Form = class extends import_react17.Component {
3429
3429
  /** Provides a function that can be used to programmatically submit the `Form` */
3430
3430
  this.submit = () => {
3431
3431
  if (this.formElement.current) {
3432
- this.formElement.current.dispatchEvent(
3433
- new CustomEvent("submit", {
3434
- cancelable: true
3435
- })
3436
- );
3432
+ const submitCustomEvent = new CustomEvent("submit", {
3433
+ cancelable: true
3434
+ });
3435
+ submitCustomEvent.preventDefault();
3436
+ this.formElement.current.dispatchEvent(submitCustomEvent);
3437
3437
  this.formElement.current.requestSubmit();
3438
3438
  }
3439
3439
  };