Replies: 3 comments 4 replies
-
Touched indicates that a field has been visited by the user. In many UI circles, receiving feedback before a user has completed their first attempt at a field is unexpected. The touched property indicates that a user may have completed their first attempt when removing focus from the field, and is often used for displaying errors. See the ErrorMessage component for example. |
Beta Was this translation helpful? Give feedback.
-
Hi Thank for your answer. I understand. For the behaviour illustrated below, when the user click on the input, the label goes on top, I rely on This work as expected when the user enters something in the input but not when the user only focus the input. My workaround is :
Is there another elegant or more more straightforward way to do that ? Best regards |
Beta Was this translation helpful? Give feedback.
-
onFocus: () => setFieldTouched('name of formik field you want to set touched property', true), |
Beta Was this translation helpful? Give feedback.
-
Hello
I wonder why the field is not marked as touched when the user focus on the input, even without typing anything.
Best regards
Beta Was this translation helpful? Give feedback.
All reactions