FormItem isTouched requirement unnecessary and hides actual valid errors
See original GitHub issueI’m current working on a form that uses both inline and form-wide validation. I’m trying to cover all cases of someone using the form and trying to pass validation.
One scenario being, someone who doesn’t fill out the form of required fields, and just presses submit and/or triggers the validateForm() function.
Using the current state of the FormItem component, even though Formik is legitimately passing proper errors, because the FormItem is checking for isTouched, it won’t actually display any of the errors. So the user actually doesn’t know why he can’t submit (even though there are errors)
This needs to be fixed asap imo
Issue Analytics
- State:
- Created 4 years ago
- Comments:14 (8 by maintainers)
Top Results From Across the Web
Form - Ant Design
High performance Form component with data scope management. Including data collection, verification, and styles.
Read more >Form - Ant Design
High performance Form component with data scope management. Including data collection, verification, and styles.
Read more >Ant design Form.Item validation style - Stack Overflow
If you want to change style of validation messages/input border color without using className property you can use the following solution.
Read more >show message validate error input once at a time ant design ...
How to show Antd form validation error message at below the input field? ... <Form.Item label="Email" name="email" rules={[ { required: true, ...
Read more >'Media selection' form control didn't trigger postback
Kentico fixes reported bugs within 7 business days by releasing a hotfix. ... with possible exceptions in the case of serious bugs, no...
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 Free
Top 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

Would enabling the
SubmitButtonbe a solution (or at least workaround) for this case? I.e. you can do<SubmitButton disabled={false} />(https://codesandbox.io/s/x2941k7vpz) to override the default behavior (SubmitButton is only enabled if form is dirty).Hello again @jannikbuschke
I agree with what you said. My message was just to let people know that if they are having this issue, they need to add the initial variable as null (altho i remember having some value that was not working, i think it was an empty array, but changing it to a null worked). Also, i’m just taking a guess, but i think this behaviour may be coming from formik and not with formik-antd.