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.

`validateAll` is not validating fields attached in runtime.

See original GitHub issue

Versions:

  • VueJs: "vue": "^2.2.6",
  • Vee-Validate: "vee-validate": "^2.0.0-rc.5",

Description:

validateAll is not validating fields attached in runtime.

Steps To Reproduce:

https://jsfiddle.net/bk6w74vd/5/

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
frangeriscommented, Jun 2, 2017

After debugging found this:

// works sending options
this.$validator.attach('username', 'required', {
    getter: (context) => context.value,
    context: () => 'context'                
})

options parameters is required when attaching new field in runtime,

@logaretm Any chance to add default values in case is missing? something like this here

    field.getter = options.getter ? options.getter : (context) => context.value;
    field.context = options.context ? options.context : (context) => context;
0reactions
logaretmcommented, Jun 5, 2017

It passes the test because the value is provided with validate here

so it does not have to resolve anything, the only instance where it tries to resolve the values is when you call validateAll without values passed in.

Conditional expressions could be the best way to do it in your situation ATM, I will try to improve the validate API to make it less confusing and possibly only have a validate method which I will overload with current behaviors.

Read more comments on GitHub >

github_iconTop Results From Across the Web

vee-validate Validating a non-existent field error in console
The problem is I am getting this error when I try to validate my fields with VeeValidate. The errors shows ...
Read more >
How to Validate Your Data with Custom Validators of Pydantic ...
Use root validators to validate all fields. By default, the values argument of a validator only stores the fields that have already been ......
Read more >
Input Validation - an overview
Whitelisting. Whitelist validation is the practice of only accepting input that is known to be good. This can involve validating compliance with the...
Read more >
Validator API | VeeValidate
when validation is done, the Promise resolves a boolean indicating whether the selected was valid or not. validateAll(fields?: String or Object), Promise< ...
Read more >
Validations Module
This feature is supported by the Mule runtime as of Mule 3.7.0 in both Community and Enterprise ... which in practice means that...
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