-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Why do I need to manually call setFieldTouched? #955
Comments
Have you tried using |
@Saifadin -- yes, unfortunately the information only shows up within that object after I manually call setFieldTouched. For instance, if I have:
My |
Can you provide the place, where you call that Component from? Basically the |
Sure, take a look below--the onSubmit properly displays my TextInput value as well:
|
It seems to work for me 😅, can you recreate it in codesandbox and provide a url. |
@Saifadin -- it works fine with the https://codesandbox.io/s/7mmmk82q9q I feel like handleChange should cover setting the field to touched (without a manual call to |
You need to pass handleBlur or call setFieldTouched after blur on the input. |
Hello, I am attempting to utilize the Formik Field component along with a custom, internally developed TextInput component. Unfortunately, it appears that even after I wire-up the
form.handleChange
event, the field is not showing as touched when typing into it. Here's my component code:As you can see, I need to manually call the
form.setFieldTouched
function as without it, the field is not showing as touched after being touched. Unfortunately, I also need to check whether this has already been done as I see severe performance degradation when calling setFieldTouched on each keystroke -- not to mention it's unnecessary.Any thoughts? Thanks!
The text was updated successfully, but these errors were encountered: