-
-
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 on text input on chrome mobile not behaving #9299
Comments
Works fine on Chrome mobile... |
That was quick. Still not working for me and I'm not the only person to have observed this. I'll put up a video if I get a moment. |
If I cannot reproduce, I cannot do much so a video won't help unfortunately... I guess you have a plugin that interferes with how |
Yup. We just tried it in the office and every Android we tried shows the problem. Galaxy S4, S7 and S9, a Wiko Ufeel Prime. Safari on Iphone 7 behaves as expected, doesn't show the issue. My anonymous jsbin has expired, so here's a new one if you'd like to retest |
The issue seems even more random than described. On the v-model input, updates are more frequent when adding chars in the middle of the string, or when deleting. Chars added at the end of the string are only updated when the user leaves the field or when when the cursor is repositioned! The Decomposed input is meant to behave exactly like v-model, but in fact behaves much better - updates are processed with every keystroke. On all 5 phones tried! All phones have default keyboard, and no chrome extensions that anyone's admitting. |
Experienced it on a Honor 8, but it worked fine on other Androids like Pixel 2, Samsung Galaxy something, ... |
Was the Honor 8 in some weird language :-) We're all in France, so I'm wondering if the language setting of the keyboard has something to do with it (5 out of 5 androids tried in our office showed the issue) |
My phone (the Honor 8) is set to German/English and the other (working) ones to pure German. |
This is also an issue on OnePuls 6 and Samsung Galaxy S7. Tested on Firefox and Chorme with Gboard and Samsung Keyboard (Samsung only). CodeBoard keyboard on OnePlus works with no issue, so this seems to be keyboard dependent. |
Also experiencing this in Chrome on a Pixel 2, Brave and Firefox on Pixel 1. It does pick up the input if the first character is a number, but not letters. Works fine on desktop. |
This comment has been minimized.
This comment has been minimized.
I was able to reproduce the same behaviour using the following simple JSFiddle (which uses Vue.js v2.6.8) For mobile phones: https://jsbin.com/damesok/1 |
Experiencing this on: Chrome: 73.0.3683.90 The model properly updates when I:
Will not properly update when I:
|
@posva commented in the related issue #9777:
in my YouTube demo above, you indeed see this underlined text, so apparently, there is this "composition" process going on. do you all agree, that most users (and as you can see even developers) are not aware of this composition step and its limitations? is there no way to ignore this and still update the model as expected? thanks @posva! |
This comment has been minimized.
This comment has been minimized.
@bbsimonbb I totally agree and I'm with you! I guess we should poke @posva 🙊 |
v-model is not like @input. What keyboard are you using on what android
That behaves like composing (and seems to be using it)?
On Mon 1 Apr 2019 at 12:21, Alexander Gruschina ***@***.***> wrote:
@bbsimonbb <https://github.com/bbsimonbb> I totally agree and I'm with
you! I guess we should poke @posva <https://github.com/posva> 🙊
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#9299 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAoicbtbjzurpKrGgIbF59b1kufxnC4Aks5vcd3BgaJpZM4Z5Dvn>
.
--
Eduardo San Martin Morote
|
|
@posva you say v-model is not like v-on:input, but the docs say the opposite. I'm not raising this issue because I'd like it to work some way. I'm raising it because the docs say it works like X and it very plainly doesn't. A solution to this issue would be to correct the docs. (but v-on:input works very well, works like using a hard keyboard, even if I'm using composition) I'm using Gboard. Gboard might well be on all the phones used when we tested this, since it's installed by default. |
The section of the docs that you link to explicitly talks about using v-model on components. Which is something very different from using That is documet here, and you can see that v-model does a lot of things that One of these things that v-model does is what @posva described: it intentionally waits for spaces or numbers before updating if the input is a "composing" one. That's what he means. Please note that I'm not claming who's right about the reported issue since I haven't investigated so far - I merely wanted to correct your specific misconception about the docs and the behaviour of Either way, I would agree that docs can be improved regarding this behaviour Edit: Your example works fine with my normal keyboard, and it shows the described behaviour with the GBoard keyboard indeed. |
@LinusBorg Ok I'm starting to get it, but I don't agree ! The section of docs I quote is, as you say, v-model for components, but when it says "remember that", it's clearly saying what v-model does in general, not just on components. Understanding all that, I can see that the current behaviour is consistent and there's a reason for it (the input is 'provisional' and might change). But even when you understand it, it doesn't seem right to wait indefinitely and not see your model updated. I think the best choice in most situations will be to ditch v-model and use v-input. (Remember we're talking about text input in any languages on any Android device with default settings. It's a big slice of the pie). If this behaviour suits the input of logographic (chinese) characters, couldn't we add a test to switch it off for latin characters? |
Ok well thanks to everyone who took the time to talk me through this. Clearly I got a bit stuck on one idea of how it should work. I'll try and be a bit sharper next time. |
Same here. Thanks everyone! 🙏 |
Ignore `composing` value on the input and eagerly modify the value while the user is still composing a value. vuejs#9299 vuejs#9777
You can not use v-model for some mobile browsers (like Chrome for android) in this case. I've spent a few hours before solving this. I've found that you couldn't type in the input when using mobile browsers with virtual keyboard - simply after typing one letter input was cleared instantly. It looks like there's some problem with emitting an event in Vue. More info: vuejs/vue#9299
just use @input instead of v-model.... here, it works: |
I came across this issue today as well. But i really cannot understand it. |
I also came across with the same issue today on my Android chrome mobile browser. The This has to work because the input field is attached to an auto-complete and it is not working because of this |
Use v-on:keyup for to monitor changes in input boxes. v-on:change should be
used select boxes
…On Fri, May 22, 2020, 4:00 AM Rukshan Ranatunge ***@***.***> wrote:
I also came across with the same issue today on my Android chrome mobile
browser.
The v-on:input or v:on-change is not firing when typing on the mobile
device.
This has to work because the input field is attached to an auto-complete
and it is not working because of this
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#9299 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ALP3ZWQMU5QQN43YIFFWKVDRSXTEFANCNFSM4GPEHPTQ>
.
|
This still does not work when it comes to mobile. The problem is the |
This should be triggered by a space bar, due to the composition thingy.
Reference: [https://github.com//issues/8231] |
For anybody still having the issue: Adding Reference: |
This comment has been minimized.
This comment has been minimized.
I have answered this question so many times already and even provided an alternative (#9814). #9777 (comment) explains it best. @nolimitdev this is enough, as a maintainer, I deserve to be treated better than that (especially when it's repeated behavior). |
Version
2.5.16
Reproduction link
https://jsbin.com/juzakis/1
Steps to reproduce
Open the jsbin on Chrome mobile. Type some text in both inputs.
What is expected?
v-model should be updating the model on input, after each keystroke, as in the Decomposed input.
What is actually happening?
The v-model input is not updated until the user leaves the field.
Seems like an issue to me. Chrome desktop shows the correct behaviour - the model is updated after every keystroke.
The editable jsbin is here. This issue came from
this stackoverflow question
The text was updated successfully, but these errors were encountered: