-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
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
Accessing errors[] locks up inputs using :value #396
Comments
The problem does not lie within the error object, It lies within the update cycle, when errors mutate, the UI updates which reverts the value to the initial value, I'm not sure how am I going to fix this, I will have to read more about Vue's update cycle. For example you can get a similar bug if you build your own simple validator: |
That explains why it's not an issue with The workaround for me was to |
How to fixed this Bug? |
I hit a brick wall trying to fix this, the only valid solution is to use also take a look at this issue: vuejs/vue#3924 |
Versions:
Description:
Accessing errors array in method or data prevents input value from updating. Not an issue if errors array is never accessed (although you need access to this array to present errors). Also not an issue if you use
v-model
instead of:value
(in my situation, not desirable).Steps To Reproduce:
<input v-validate="'required'" name="somefieldname" :value="someprop" />
this.errors.errors
orthis.$validator.errorBag.errors
This happens if error object methods are accessed as well (eg.
errors.any()
orerrors.has()
).The text was updated successfully, but these errors were encountered: