New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
OnChange handler is not working. #1385
Comments
onChange is working for me when the onChange handler is in the scope of the Form object but not when in it is passed in as a property. However, handleSubmit is passed in as a property and it works.
|
Can you try this?
|
<Formik initialValues={{ Title <Input title="title" type="text" onChange={(e:React.ChangeEvent)=> setFieldValue("title",e.target.value)} onBlur={handleBlur} value={values.title} disabled={isSubmitting} isInvalid = {touched.title && !!errors.title} /> {touched.title && errors.title && {errors.title} }
|
When dealing with dates
|
馃悰 Bug report
Current Behavior
I have seen examples of onChange handlers attached to Formik
<Field />
components, which appear to fire on input changesIn keeping with these examples, I have added an
onChange
handler to a<Field />
component. The problem is that this handler function is not being called when the child input changes (it is a<select>
).Expected behavior
When a new option on the
<select>
is chosen, the handler should fiireReproducible example
<Field name={id} onChange={(e: any)=>console.log(e)}>
Suggested solution(s)
Explain how to correctly supply an onChange handler to a Formik form.
Your environment
The text was updated successfully, but these errors were encountered: