-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Open
Labels
awaiting responsebugneeds reproducible exampleMissing a link to a reproduction in the playground, CodeSandbox, JSFiddle, etc.Missing a link to a reproduction in the playground, CodeSandbox, JSFiddle, etc.
Description
Prerequisites
- I have searched the existing issues
- I understand that providing a SSCCE example is tremendously useful to the maintainers.
- I have read the documentation
- Ideally, I'm providing a sample JSFiddle, Codesandbox.io or preferably a shared playground link demonstrating the issue.
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
- Register a Custom Widget
- Use custom widget in a form
Environment
- OS: macOS Sonoma
- Node: v22.3.0
- npm: 10.8.1
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
Metadata
Metadata
Assignees
Labels
awaiting responsebugneeds reproducible exampleMissing a link to a reproduction in the playground, CodeSandbox, JSFiddle, etc.Missing a link to a reproduction in the playground, CodeSandbox, JSFiddle, etc.