-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
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
v-model.lazy is not updating the value of an input when it has a focus #8346
Comments
Misunderstood this issue at first glance. It is a bug. |
As a temporal workaround, you can do blur the input then focus it (I used a ref on the input) if (name === 'Jacob') {
this.$refs.input.blur()
this.name = 'Joseph';
await this.$nextTick()
this.$refs.input.focus()
} |
Another workaround that suited me was to replace v-model with appropiate |
To me this worked, I think is not a bug. |
According to a comment in sourcecode Focused element should never be updated. From this bug it seems like it should, the update function will not be called unless user press enter or blur anyways it seems redundant to me. |
Well, to me worked, without changes or fixes. |
works well for me |
sodatea please review my pr, no need to revert the entire commit just the restriction on updating lazy elements while focused |
@tonyraoul Remove that restriction will cause another issue as described in #7153 |
This is annoying. Will it be resolved in next version? |
Closed via 080dd97 |
Version
2.5.16
Reproduction link
https://jsfiddle.net/twyqL8k4/
Steps to reproduce
What is expected?
Value property of the input element should be changed to Joseph, as was the value of the name property in the Vue instance.
What is actually happening?
Value property of the input element is not being changed.
The value of the input is correctly being updated when using v-model without .lazy modifier.
The text was updated successfully, but these errors were encountered: