-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
Description
Version
2.5.17
Reproduction link
https://vuejs.org/v2/guide/forms.html#Text
Steps to reproduce
First off, the docs claim here that using v-model
is identical to using v-bind:value="searchText"
and v-on:input="searchText = $event.target.value"
.
It does have the same behavior on desktop, but with chrome on android the behavior is different. When using v-model
on android/chrome the model only gets updated when pressing space, enter, backspace or unfocusing the field (and maybe in some other cases). The model does not update when in the middle of typing a word. However when using v-bind
and v-on:input
the model gets updated as it is supposed to.
It seems like v-model
isn't binding the input
event on android. The correct behavior can be achieved by adding v-on:input
regardless of whether v-model
or v-bind:value
is used. This applies to input
and textarea
elements.
What is expected?
The behavior is expected to be the same on all platforms: The model should update live with every keypress.
What is actually happening?
On chrome on android the model isn't updated on every keypress. This can be reproduced with the example inputs that are shown in the docs.
This is a problem when for example creating a list that should be filtered live with user input. I'm wondering whether this is a bug or a documentation issue. I feel like it's a bug since the same code has different behavior on different platforms.