When submitting the form, the previous errors are not cleared, although they are fixed.
This only happen if you use a controlled Form (from @rjsf/material-ui: 2.3.0). Uncontrolled Form works as expected.
Possible regression, as this has been reported before and since fixed (the linked sandbox in that issue no longer reproduces the problem).
Displayed error message should go away on submit if there are no errors.
Displayed error message persists.
PS: onSubmit is called and event.errors is correctly empty: [].
2.3.0
@rjsf/core: 2.3.0
@rjsf/material-ui: 2.3.0
A usable workaround for this problem is to set the prop liveValidate. Live validation correctly updates error messages, as opposed to only validating on submit.
(I prefer to enable liveValidate once the user has clicked submit, to avoid showing error messages before they have started filling out the form.)
I've also recently encountered this issue in the @rjsf/core Form component. In my case, I'm presenting async server errors with the extraErrors prop as described in the docs. However, if there are any schema validation errors (which are then corrected) before the submit button is clicked again and onSubmit is handled, those aren't cleared.
This seems to be introduced in 2.0.1. I've reverted back to v 2.0.0 and it started working again. Probable commit for this behavior change would be https://github.com/rjsf-team/react-jsonschema-form/commit/72963385db4753243d134641709b7a47930a4687
Most helpful comment
This seems to be introduced in 2.0.1. I've reverted back to v 2.0.0 and it started working again. Probable commit for this behavior change would be https://github.com/rjsf-team/react-jsonschema-form/commit/72963385db4753243d134641709b7a47930a4687