question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

v-model behaves inconsistently in comparison to docs

See original GitHub issue

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.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

9reactions
posvacommented, Aug 28, 2018

it’s talking about v-model in components which is indeed what is explained but is different from input’s v-model


Please, next time consider using the forum, the Discord server or StackOverflow for questions first. But feel free to come back and open an issue if it turns out to be a bug 🙂

7reactions
xPawcommented, Aug 28, 2018

@posva Then why does the documentation talk about v-model in input?

As per the report, input model is not immediately updated on Android when typing. There’s plenty of issues reported in Vue regarding this specific use case already. Either the documentation needs to be updated to reflect that or Vue internally should handle it better.

It automatically picks the correct way to update the element based on the input type.

This doesn’t particularly sound correct to me.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Comparable (Java Platform SE 8 ) - Oracle Help Center
This is so because sorted sets (and sorted maps) without explicit comparators behave "strangely" when they are used with elements (or keys) whose...
Read more >
Table 7, DSM-IV to DSM-5 Attention-Deficit/Hyperactivity ...
Table 7DSM-IV to DSM-5 Attention-Deficit/Hyperactivity Disorder Comparison ; A. Either (1) or (2):, A. A persistent pattern of inattention and/or hyperactivity- ...
Read more >
Quiz settings - MoodleDocs
How questions behave: This is the primary way to control the experience a student has as they interact with each question in the...
Read more >
Train and Evaluate AWS DeepRacer Models Using the AWS ...
To train a reinforcement learning model, you can use the AWS DeepRacer console. ... For a discrete action space of m number of...
Read more >
Icon component — Vuetify
The v-icon component provides a large set of glyphs to provide context to various ... currently behaves inconsistently across browsers .
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found