Open
Description
Prerequisites
- [ . ] I have read the documentation;
Description
Requirement
Actually I want to implement onBlur feature for every single field in my form.
What I'm doing:
I'm able to achieve onBlur validation -> using ObjectFieldTemplate and passing onBlur at every item level explicitly.
and, Inside my onBlur function, after validation -> I'm setting the extraErrors using setState.
I have added screenshot of my implementation as first comment in thread.
Issue:
So since state is getting update -> the next field in form is loosing its focus. This is where I'm blocked now.
Do we have a better way of achieving the same or what might be going wrong that my form is loosing focus.
Steps to Reproduce
- Create form with '@rjsf/material-ui'
- use ObjectFieldTemplate to render fields.
- Inside ObjectFieldTemplate function -> add onBlur function and inside that set the state of extraErrors
Expected behavior
On state update -> field shouldn't loose its focus
Actual behavior
Focus is getting lost when I update the errors using onBlur
Version
2.3.0