rjsf-team / react-jsonschema-form

A React component for building Web forms from JSON Schema.
https://rjsf-team.github.io/react-jsonschema-form/
Apache License 2.0
13.76k stars 2.16k forks source link

Bug: Programmatic submit not working properly in Firefox(#3121). #4150

Closed abdalla-rko closed 1 month ago

abdalla-rko commented 2 months ago

Reasons for making this change

[Please describe them here]

The programmatic submit is not preventing the default form submission in Firefox. This is because the dispatched custom submit event is not the same event as the actual formSubmitEvent. Also the ref.current.formElement.current.requestSubmit() workaround doesn't work on Safari. This fixes the issue by preventing the default form submission.

bug #3121

Checklist

heath-freenome commented 1 month ago

@abdalla-rko Can you make sure that this works fine with Chrome as well?

abdalla-rko commented 1 month ago

Hey @heath-freenome, It's working fine on Chrome on my end. Did I introduce any issues? If yes could you elaborate?

heath-freenome commented 1 month ago

Hey @heath-freenome, It's working fine on Chrome on my end. Did I introduce any issues? If yes could you elaborate?

Nope, I just wanted to be sure. Thanks for checking.