validateField not working
See original GitHub issue🐛 Bug report
When calling validateField the field is not validated
Current Behavior
Here is a repository to checkout and click the button labeled “Next Step” which is supposed to validate field “email” https://github.com/cyberprodigy/formik-single-field-validation-bug
Expected behavior
When the method validateField is called it should display that the field is required
Reproducible example
Checkout https://github.com/cyberprodigy/formik-single-field-validation-bug execute `npm start`` Observe that no validation is happening
Suggested solution(s)
It should display the error when validateField is invoked. You can trigger focus() followed by blur() to obtain the desired behaviour, but that is not a solution
Additional context
Your environment
Software | Version(s) |
---|---|
Formik | 1.5.8 |
React | 16.9.0 |
TypeScript | |
Browser | |
npm/Yarn | |
Operating System | Mac Mojave |
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:18 (7 by maintainers)
Top Results From Across the Web
Formik validation not working for my custom react-places ...
I have the following component that makes a form and use formik for form validation and has a custom input field created with...
Read more >NetSuite Applications Suite - ValidateField Sample
The ValidateField function is called whenever the user changes the value of a field. This function returns false to reject the value.
Read more >Client Script Validate Field Function - validateField - SuiteRep
The purpose of the client script validate field function is to control what can and can't be entered in a certain field.
Read more >unable to validate field mapping - Informatica Network
Hi , I am working on course 101 and I am not able to validate any of the field mappings in Data Synchronization...
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
Also running into this in a form with a
validationSchema
but novalidate
.Looks like if there is no
validate
function on a field, it just callsPromise.resolve()
https://github.com/jaredpalmer/formik/blob/master/src/Formik.tsx#L426Also the full TypeError is
"_this.fields[field].props.validate is not a function"