Skip to content
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

FormikTouched is typed incorrectly for primitive array values #3455

Open
kmurgic opened this issue Jan 11, 2022 · 2 comments
Open

FormikTouched is typed incorrectly for primitive array values #3455

kmurgic opened this issue Jan 11, 2022 · 2 comments

Comments

@kmurgic
Copy link

kmurgic commented Jan 11, 2022

Bug report

Current Behavior

For values { x: string [] }, touched is being typed as { x?: boolean }

Expected behavior

For values { x: string [] }, touched should be typed as { x?: boolean[] }

Reproducible example

https://codesandbox.io/s/infallible-shape-nhd9i?file=/index.tsx:537-685
Edit the names of one of the friends. Note that in the console touched.friends is an array of booleans.

Suggested solution(s)

Replace boolean with boolean[] here
I plan on making opened up a one line PR.

@kmurgic
Copy link
Author

kmurgic commented Jan 11, 2022

Opened a PR

newbie-k pushed a commit to newbie-k/formik that referenced this issue Sep 29, 2024
@quantizor
Copy link
Collaborator

I think this is intended behavior, touched is describing the field not the contents of the field.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants