react-jsonschema-form
react-jsonschema-form copied to clipboard
how to trigger validation only for fields that have changed when certain fields change?
Prerequisites
- [X] I have read the documentation
What theme are you using?
core
What is your question?
how to trigger validation only for fields that have changed when certain fields change?
for example, when the field A changed, I only want to validate the field A.
What's the problem you're trying to solve?
Ajv validation is all-or-nothing, so off the top of my head, maybe you could keep track of which fields have been changed by the user, then use transformErrors to remove errors on all fields that have not been touched?
@DualWield To add to @nickgros comment, the onChange() handler is sent the id of the field on which a change occurred (if there is no id then likely it is change done to add default values).
This issue has been automatically marked as possibly close because it has not had recent activity. It will be closed if no further activity occurs. Please leave a comment if this is still an issue for you. Thank you.
This issue was closed because of lack of recent activity. Reopen if you still need assistance.