You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
π onBlur handler and real time validation on useField hook
Hello!
I started learning and practicing Formik, but ran into one problem. My project uses custom placeholders that move up with the focus field.
What do I need for thisβ
Functional component with isFocused state
Change it with onFocus and onBlur
Depending on the state, change the position of the placeholder
πͺ Started to do
To do this, I made a component CustomField with the useField()hook. Works, cool π
But later he noticed that real time validation and error messages stopped working π€¦ββοΈ. Because I redefined onBlur handler. After searching, studying the problem did not find a solution using onBlur handler without interfering with Formik.
π onBlur handler and real time validation on useField hook
Hello!
I started learning and practicing Formik, but ran into one problem. My project uses custom placeholders that move up with the focus field.
What do I need for thisβ
onFocus
andonBlur
πͺ Started to do
To do this, I made a component
CustomField
with theuseField()
hook. Works, cool πBut later he noticed that real time validation and error messages stopped working π€¦ββοΈ. Because I redefined
onBlur
handler. After searching, studying the problem did not find a solution usingonBlur
handler without interfering with Formik.Prepared Sandbox π Sandbox
π Please tell me what and where I missed, how can this be implemented? Thanks!
The text was updated successfully, but these errors were encountered: