G
G
Gleb Nikolaev2021-10-25 03:59:21
Android
Gleb Nikolaev, 2021-10-25 03:59:21

How to make @input or similar handler for this event work on mobile?

If on a mobile device, in particular on an android (I reproduced it on firefox and chrome), open an example from. site with documentation on vuejs in the form processing section:
https://ru.vuejs.org/v2/guide/forms.html#%D0%A2%D0...

<input v-model="message" placeholder="отредактируй меня">
<p>Введённое сообщение: {{ message }}</p>


And try to enter text in the input field, then the text input event in the field (or an analogue - @input) will not work until you press the enter button, space or some punctuation mark on the keyboard .
I also created an event observer:

watch: {
        message: {
            console.log('Yo!');
        }
},


But it doesn't work on mobile either.
Please tell me what can be done to make this code work like on the desktop, namely, the event fired right at the time of entering text in the field

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Aetae, 2021-10-25
@Aetae

https://github.com/vuejs/vue/issues/9777#issuecomm...
@input just should work:

Just think about whether you need it, because if this is some kind of autocomplete and search, then direct input will search for something extra instead of waiting for the user to select a mobile keyboard hint.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question