2.5.16
https://jsfiddle.net/twyqL8k4/
Value property of the input element should be changed to Joseph, as was the value of the name property in the Vue instance.
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.
Can not reproduce on macOS 10.13.5 + Chrome 67.0.3396.87 / Safari 11.1.1 (13605.2.8).
Could you update issue description to include you operating system and browser version?
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 :value and @change :)
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
The bug is introduced by this commit:
https://github.com/vuejs/vue/commit/60da366a2653a3984d79331d02ebb2ecf7e73a9a
But reverting it will reopen https://github.com/vuejs/vue/issues/7153
The only fix that can solve both bugs is to revert that commit along with nextTick implementation. So now adding a "nextTick related" label
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 https://github.com/vuejs/vue/issues/7153
This is annoying. Will it be resolved in next version?
Closed via 080dd971
Most helpful comment
As a temporal workaround, you can do blur the input then focus it (I used a ref on the input)