We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug
The documentation for $error states...
$error
Equivalent to this.$dirty && !this.$pending && this.$invalid.
this.$dirty && !this.$pending && this.$invalid
However in testing it's clear that $error can be true while $pending is also true.
true
$pending
While async validators are executing, the $error state reports incorrectly.
Reproduction URL
I've set up a CodeSandbox example with watchers on $error, $errors and $pending here ~ https://codesandbox.io/s/nostalgic-feistel-dd80ii?file=/src/App.vue
$errors
You can see from the logs that the logic is not correct
1650509056935 "$pending:" true 1650509056937 "$error:" true 1650509056937 "$errors.length:" 0 1650509057937 "$error:" false 1650509057937 "$pending:" false
To Reproduce
Configure an async validator and use something like this to throw some errors
<p v-if="v$.field.$error">{{ v$.field.$errors[0].$message }}</p>
Expected behavior
$error should be false if $pending is true based on the documentation.
false
Additional context
Originally from StackOverflow here ~ https://stackoverflow.com/q/71940268/283366
The text was updated successfully, but these errors were encountered:
Hey there, sorry for the late reply.
This was changed in #914
Please check the issue and PR and let me know what you think. We cant fix it for all cases I am afraid :/
Sorry, something went wrong.
docs(readme): correct $error equivalence
863960e
As vuelidate#1046 suggests, `$error` is true when the form is `$dirty` and either `$pending` or `$invalid`.
No branches or pull requests
Describe the bug
The documentation for
$error
states...However in testing it's clear that
$error
can betrue
while$pending
is alsotrue
.While async validators are executing, the
$error
state reports incorrectly.Reproduction URL
I've set up a CodeSandbox example with watchers on
$error
,$errors
and$pending
here ~ https://codesandbox.io/s/nostalgic-feistel-dd80ii?file=/src/App.vueYou can see from the logs that the logic is not correct
To Reproduce
Configure an async validator and use something like this to throw some errors
Expected behavior
$error
should befalse
if$pending
istrue
based on the documentation.Additional context
Originally from StackOverflow here ~ https://stackoverflow.com/q/71940268/283366
The text was updated successfully, but these errors were encountered: