question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:open
  • Created 4 years ago
  • Reactions:5
  • Comments:11

github_iconTop GitHub Comments

5reactions
micheleberetta98commented, Jul 29, 2019
1reaction
micheleberetta98commented, Aug 27, 2019

Is this dead?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found