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

Add "shouldValidate" parameter to "setValue" and "setTouched" field helpers #2370

Closed
avasuro opened this issue Mar 17, 2020 · 0 comments · Fixed by #2371
Closed

Add "shouldValidate" parameter to "setValue" and "setTouched" field helpers #2370

avasuro opened this issue Mar 17, 2020 · 0 comments · Fixed by #2371

Comments

@avasuro
Copy link
Contributor

avasuro commented Mar 17, 2020

🚀 Feature request

Current Behavior

In a recent pull-request (#2116) were added ability to force trigger/prevent validation when calling setFieldValue and setFieldTouched methods, but this ability is still missing in FieldHelperProps.

Desired Behavior

Need to have ability to force trigger/prevent validation using FieldHelperProps, so interface of this methods will look like:

setValue(value: any, shouldValidate?: boolean): void
setTouched(value: boolean, shouldValidate?: boolean): void

Suggested Solution

Just pass-through "shouldValidate" argument inside setValue/setTouched method down to the setFieldValue/setFieldTouched method.

Who does this impact? Who is this for?

All users

Describe alternatives you've considered

Now instead of this I forced to use formik context methods (setFieldValue and setFieldTouched) directly, which is a little bit less convinient.

Additional context

-//-

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

Successfully merging a pull request may close this issue.

1 participant