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
I have a form with two fields and a validation logic that is dependent on both. But only the current field error gets mapped to the form state and the form state does not match with the validation logic anymore.
Current Behavior
When one of the fields get changed the validation only gets triggered for that field. This causes wrong state and errors in the form state.
Expected behavior
It only appears on the newest version 2.0.1-rc.10 and I saw the comment in the release. I wanted to be 100% sure if this use case will not be supported in the future.
Having a validation function that always handles the validation on all the values and returns the error object for all the values should be used as is for the form state.
For me personally, it is quite confusing that I am able to define a validation function that return the complete error object but only the field error gets mapped on the form state.
Or do I miss something?
Your environment
Software
Version(s)
Formik
2.0.1-rc.10
React
16.8.6
TypeScript
-
Browser
Chrome
npm/Yarn
yarn
Operating System
macOS Mojave
The text was updated successfully, but these errors were encountered:
🐛 Bug report
I have a form with two fields and a validation logic that is dependent on both. But only the current field error gets mapped to the form state and the form state does not match with the validation logic anymore.
Current Behavior
When one of the fields get changed the validation only gets triggered for that field. This causes wrong state and errors in the form state.
Expected behavior
It only appears on the newest version
2.0.1-rc.10
and I saw the comment in the release. I wanted to be 100% sure if this use case will not be supported in the future.Reproducible example
https://codesandbox.io/embed/goofy-lumiere-pvb3d
Suggested solution(s)
Having a
validation
function that always handles the validation on all the values and returns the error object for all the values should be used as is for the form state.For me personally, it is quite confusing that I am able to define a
validation
function that return the completeerror
object but only the field error gets mapped on the form state.Or do I miss something?
Your environment
The text was updated successfully, but these errors were encountered: