Loses the focus after entering one key input #7660
-
I'm trying to build a simple form and trying to use Here is the Codesandbox link: https://codesandbox.io/s/happy-haze-h2y8b?file=/src/FormField.js Problem: When I key in one character it loses focus. (It happens only once) again it loses the focus on validation failure. What I have tried: When I remove the Any clue Where I have done wrong. Any help/advice would be appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 17 replies
-
works for me. |
Beta Was this translation helpful? Give feedback.
-
Screen.Recording.2022-01-25.at.11.56.30.pm.mov |
Beta Was this translation helpful? Give feedback.
-
export default function App() {
// bug is bleow your component is getting unmount and remount each render move it out
const FieldWrapper = styled.div`
margin-top: 45px;
`; to // bug is bleow your component is getting unmount and remount each render move it out
const FieldWrapper = styled.div`
margin-top: 45px;
`;
export default function App() { not a hook form related issue |
Beta Was this translation helpful? Give feedback.
-
I have similar issue but caused by disabling all controls when <Form {...form}>
<form
onSubmit={_onSubmit}>
<fieldset
disabled={
props.disabled ||
form.formState.isLoading ||
form.formState.isValidating ||
form.formState.isSubmitting
}
>
{_renderFormControls()}
</fieldset>
</form>
</Form> |
Beta Was this translation helpful? Give feedback.
to
not a hook form related issue