In case when we have specific components hierarchy and behavior, validator rules works incorrectly.
See original GitHub issueVersions:
- VueJs: 2.5.13
- Vee-Validate: 2.0.3
Description:
In case when we have specific components hierarchy and behavior, validator rules works incorrectly.
Steps To Reproduce:
FIDDLE
Place a cursor to field, and enter characters one by one, and when you enter 6th char, field still invalid. But when you enter 7th char - field goes valid.
Also, if you would remove chars one by one, field becomes invalid only when there remaining 4 chars.
But I was set a rule v-validate="'min:6'"
description:
- comp - just wrapper over
<input>
which emits “input
” event and has ‘value
’ prop - comp - input element which gets object as a ‘
value
’ prop, copies it todata.item
, passes one of object’s prop to child №1 component as:value
, and listens to ‘input
’ event from child №1 component, then updates owndata.item
object with new prop value, then emits ‘input
’ event with updateddata.item
object - comp has
data.value
object, and passes it asv-model
to child №2 component.
Also, if I place a console.warn
into node_modules/vee-validate/dist/vee-validate.esm.js
locally
var min$1 = function (value, ref) {
var length = ref[0];
if (value === undefined || value === null) {
return false;
}
console.warn(value);
return String(value).length >= length;
};
I get two logs in console, first has new value, but second has prev value, so validator validates field twice, but because of smth, it tries to validate old value in second time.
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Validation Rules - Salesforce Help
Define Validation Rules A validation rule can contain a formula or expression that evaluates the data in one or more fields and returns...
Read more >The Data Validation Cookbook
Validating data is all about checking whether a data set meets presumptions or expectations you have about it, and the validate package makes...
Read more >Hibernate Validator 8.0.0.Final - Jakarta Bean Validation ...
In case your application has specific validation requirements have a look at Chapter 6, Creating custom constraints.
Read more >11 Defining Validation and Business Rules Declaratively
This chapter describes how to use ADF entity objects to write business rules that implement declarative validation in an Oracle ADF application.
Read more >Response Requirements & Validation - Qualtrics
Response requirements & validation are used to alert respondents about questions they may have missed, or they can be used to solicit a...
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
+1 to this problem. For me, the validation fires twice: As I saw, the second time this fires here:
But I don’t use an debounce in this validation. Maybe It can be a hint for solving…
I looked the FIDDLE of @xodock and it works correctly only on version rc-27, but any next version breaks the fiddle.
For now I rolled back to rc-27. 😦
VeeValidate 3.0 has been released with a new approach, this is sadly no longer applicable.
The new version has a lot of breaking changes, so make sure to read the new documentation carefully!