Touched state isn't correct when dealing with array values
See original GitHub issue🐛 Bug report
Current Behavior
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.
Expected behavior
The touched state of the array field should be a boolean.
Suggested solution(s)
Additional context
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.
Your environment
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 |
Issue Analytics
- State:
- Created 4 years ago
- Reactions:5
- Comments:11
Top Results From Across the Web
Can't acces formik.errors with Yup and array of object
So looks like it's an issue : https://github.com/jaredpalmer/formik/issues/2347. Here is the hack :
Read more >Validating form input - Angular
Every time the value of a form control changes, Angular runs validation and generates either a list of validation errors that results in...
Read more >use-form - Mantine
If disabled, the touched state of the form can only be used if all values are set with setFieldValue . <TextInput {...
Read more >Vuelidate | A Vue.js model validation library
For each value you want to validate, you have to create a key inside ... You can do anything you need with the...
Read more >useFormState - Simple React forms validation
It has its scope in terms of form state subscription, so it would not affect other useFormState and useForm. Using this hook can...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Here you go https://codesandbox.io/s/relaxed-shape-67lf8
Is this dead?