react-jsonschema-form
react-jsonschema-form copied to clipboard
Form doesn't call "onError" when component was mounted with invalid form data according to schema
Description
I want to be able to get error list if validation wasn't passed when Form component was mounted.
Steps to Reproduce
- I've set valid "schema"
- I've set invalid formData according to "schema"
- I've set "liveValidate" to True
- I've mounted component to DOM
Expected behavior
The component should call "onError" with errors list
Actual behavior
The component wasn't called "onError" with errors list
Version
"^1.0.1"
P.s. Can you make me as a contributor and I will push Pull request with fix this problem ?
Any progress or solution?
I've also run into this issue. I am using rjsf as part of a larger form, and need to handle all the change and error events manually in my external form. I need onError to fire on init so I can disable my external submit button.
Here's a codepen showing the issue: https://codepen.io/antman888/pen/vYJxVga
Here is a codesandbox with the above example migrated to the latest 5.x release