-
-
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
Empty input type=number results in NaN #284
Comments
From what I understand, yup can only used for validation. Any kind of cleaning you try to do in yup will not effect the |
Hi @vuhrmeister, did you manage to solve it? I'm running into the same problem. Until I find a permanent solution, I ended up implementing this workaround:
|
@markuspelnens nope, used the same workaround (but checking for |
is there any reason for this? It seems like we should be able to use replace the form values with the values returned by Yup |
I am having the same issue, has this been fixed or is there some recommended way of dealing with this? |
try to use setFieldValue onChange={e => setFieldValue('condition.operand', +e.target.value)} |
I'm using Formik with Yup Schema validation.
I have an input field of type "number". If I enter a value and empty the field this results in a
NaN
. This behavior might be as expected. For that I added a transform function to my schema like that:Should it respect the transform function? Or is the schema actually only be used for validation, not for "cleaning" the data? If so, is there a way how to solve that? Maybe I'm missing something.
Of course, I can check the value before attaching it to the input field. But the value in the global values object stays the same.
The text was updated successfully, but these errors were encountered: