8000 Add "shouldValidate" parameter to "setValue" and "setTouched" field helpers · Issue #2370 · jaredpalmer/formik · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Add "shouldValidate" parameter to "setValue" and "setTouched" field helpers #2370
Closed
@avasuro

Description

@avasuro

🚀 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

-//-

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0