Form changes Field meta.valid to true when the validate is a Promise
See original GitHub issueAre 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:
- Created 5 years ago
- Comments:7 (2 by maintainers)
Top 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 >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
+1 for adding
validating
prop to FieldRenderProps which becomestrue
then thevalidate
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?@maciejmyslinski @erikras
Hey guys. Do you plan to change this behavior or have some advice on how to handle this scenario?
Thanks