You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have added a custom widget. When I type in it in the form, it re-renders the field, which causes it to lose focus on the input field and moves the cursor's current position to the beginning of the input field. Note: If autofocus is not present in the input props, it completely loses focus and I can't type at all.
Screen.Recording.2024-09-12.at.12.03.24.PM.mov
Expected Behavior
Ideally, it should work the same way the default input function works. It shouldn't lose focus and shouldn't rerender.
@macintushar Without looking at the code of your widget we can't help you. I'm guessing that having the field rerender itself is the cause of the issue. React is really picky about how rerenders work especially around focus/blur behaviors and how callbacks work. I would focus on that first
Prerequisites
What theme are you using?
chakra-ui
Version
5.x
Current Behavior
I have added a custom widget. When I type in it in the form, it re-renders the field, which causes it to lose focus on the input field and moves the cursor's current position to the beginning of the input field. Note: If autofocus is not present in the input props, it completely loses focus and I can't type at all.
Screen.Recording.2024-09-12.at.12.03.24.PM.mov
Expected Behavior
Ideally, it should work the same way the default input function works. It shouldn't lose focus and shouldn't rerender.
Steps To Reproduce
Environment
Anything else?
I followed the code written in the docs here
https://rjsf-team.github.io/react-jsonschema-form/docs/advanced-customization/custom-widgets-fields
The text was updated successfully, but these errors were encountered: