I have a multi-select field in Formik, which needs to be an array.
The touched state of this fields results in an empty array instead of true.
EDIT: This happens when submitting.
The touched state of the array field should be a boolean.
I have found this related issue https://github.com/jaredpalmer/formik/issues/793#issuecomment-492523947, but it is closed for inactivity, and the workaround suggested is not applicable for us.
| Software | Version(s) |
| ---------------- | ---------- |
| Formik | 1.5.8 |
| React | 16.8.6 |
| TypeScript | not used |
| Browser | Chrome 75 |
| npm/Yarn | yarn 1.16.0 |
| Operating System | Windows 10 |
Hi,
Can you reproduce the error in a codesanbox please ?
Here you go https://codesandbox.io/s/relaxed-shape-67lf8
I have the same issue here. I have some array values in my form. They represent the choices taken by the user in a multi-selection field. I handle them as traditional values.
const initialValues = {
normalValue: '',
nullableValue: null,
choices: ['defaultChoice'], // < this one is a multi-select `value`
};
The relative touched flag is an empty array instead the expected true boolean when I touch the value.
Handling arrays values is an intended Formik usage? Is this a bug of the touched logic or I'm missing something crucial?
Is there anything new about this?
Is this dead?
I'm getting the same error and I think this PR fixes #1134
How's the state on this? I have the same issue.
I'm experiencing the same problem. I can't figure out why... and it's only on submitting the form.
Confirmed issue in latest as well. It only occurs when submitting the form, normal handleBlur works perfectly.
I think it's related to this issue here - https://github.com/jaredpalmer/formik/issues/1942
Not sure if it will be solved at all.
Most helpful comment
Here you go https://codesandbox.io/s/relaxed-shape-67lf8