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.

Form changes Field meta.valid to true when the validate is a Promise

See original GitHub issue

Are you submitting a bug report or a feature request?

bug report

What is the current behavior?

When the Form validate prop receives a pending promise, the Field meta.valid changes to true.

What is the expected behavior?

The Field should use the last validate object while the promise is pending.

Sandbox Link

https://codesandbox.io/s/9pr4vj88y

What’s your environment?

react-final-form 3.6.6 final-form 4.10.0 node 10.11 multiple browsers and versions

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
tkvwcommented, Nov 16, 2018

+1 for adding validating prop to FieldRenderProps which becomes true then the validate func returns a promise and it is pending.

I think the title of this issue should be changed to something like “Add validating prop to fieldrenderprops to support state visualization using async validate” and maybe this issue belongs to the final-form issue list?

0reactions
gilbarbaracommented, Mar 23, 2019

@maciejmyslinski @erikras

Hey guys. Do you plan to change this behavior or have some advice on how to handle this scenario?

Thanks

Read more comments on GitHub >

github_iconTop Results From Across the Web

Redux form: change other field if validation success
The best solution I've found is to use onChange reduxForm() property because it's executed after the selector but I can't run after validation....
Read more >
promise validator - FormValidation
Using with form field. The HTML attributes are used to set the validator options via the Declarative plugin ... valid: true, // or...
Read more >
Form - VeeValidate
Validates all the fields and populates the errors object, returns a promise that resolves to an object containing aggregated validation result of all...
Read more >
Form validation with React Final Form + Fonk - Basefactor
Whenever a field changes, React Final Form will trigger Form validate event and Fonk will call validateForm method. Once the validate property finishes...
Read more >
reduxForm(config:Object)
When set to true and enableReinitialize is also set, the form will retain the value of dirty fields and update every registered field...
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