question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

FormItem isTouched requirement unnecessary and hides actual valid errors

See original GitHub issue

I’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:closed
  • Created 4 years ago
  • Comments:14 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
jannikbuschkecommented, May 31, 2019

Would enabling the SubmitButton be 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).

1reaction
tiagombritocommented, May 25, 2020

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found