Formik doesn't update isValidating onBlur and onChange, only onSubmit
See original GitHub issue🐛 Bug report
Current Behavior
isValidating
doesn’t reflect async validator being run onBlur and onChange even if it actually runs, as evident by ErrorMessage rendering
Expected behavior
isValidating
should update even onBlur and onChange
I checked in react-final-form
, and it does the correct thing there, updating validating
.
Reproducible example
https://codesandbox.io/s/hardcore-proskuriakova-qp9uc
Software | Version(s) |
---|---|
Formik | 1.5.7 |
React | 16.8.6 |
TypeScript | N/A |
Browser | Chrome 74 |
npm/Yarn | npm@6.5.0 |
Operating System | Windows |
Issue Analytics
- State:
- Created 4 years ago
- Reactions:8
- Comments:14 (5 by maintainers)
Top Results From Across the Web
React Formik - Trigger validation only on form submit
You can control when Formik runs validation by changing the values of <Formik validateOnChange> and/or <Formik validateOnBlur> props ...
Read more >Validation - Formik
2 const validate = (values, props /* only available when using withFormik */) => { ... It will run after any onChange and...
Read more >React form validation solutions: An ultimate roundup
This roundup is a comprehensive look at some of the most popular solutions for form management and validation in React.
Read more >Migration from Formik - Final Form Docs
React Final Form validates on every change by default, and setting validateOnBlur to true is a way to tell React Final Form to...
Read more >How to use formik with useFormik prop in react
Formik is a super cool library and I use it every time. ... I just set a state on submit and shown a...
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
We have run into the same problem. Right now, a field that requires async validation is marked as valid while waiting for the server response, after which it can jump to invalid if the validation failed. Very confusing for our users.
Problem was/is that firing isValidating was causing too many rerenders and crushing perf