react-jsonschema-form
react-jsonschema-form copied to clipboard
Feat: Allow raising errors from within a custom whatever(#2718)
Reasons for making this change
I introduced a raiseFieldErrors method to raise errors from within a custom component(see #2718).
The current behavior allows errors to be raised from custom components and when the form onChange is triggered, we clear the custom raised errors. I appreciate any feedback on this approach. If everything looks good, I'll write tests and implement this in other themes.
Checklist
- [ ] I'm updating documentation
- [ ] I've checked the rendering of the Markdown text I've added
- [ ] I'm adding or updating code
- [ ] I'm adding a new feature
- [ ] I've updated the playground with an example use of the feature
@abdalla-rko If the goal is to update the errorSchema
via a custom widget, maybe it makes sense to update the onChange
in WidgetProps
to function similarly to the onChange
in FieldProps, where the errorSchema
can be updated as it is flows through the schema hierarchy. Feel free to join the next meeting so we can talk about it. Or reach out to me on Discord
@abdalla-rko are you still working on this?
Hi @heath-freenome, Sorry for taking too long. I think the initial implementation is now like you suggested updating the errorSchema using onChange in the custom widget. Let me know if it's good and then I'll update the docs and other themes if needed.