What is the keyCode from Android's Next button? (the one that sometimes replaces Enter)

Found similar threads, but nothing seems to work for me.

I have a simple text input in my Vue app that, needs to be blurred once the user clicks Enter of whateve the "Return" button is on their keyboard. This is all fine and well on Desktop and iOS, however on Android the Enter button changes to Next and will not follow the behavior I set for it.

I’ve tried a bunch of different keycodes which I’ve found in different thread answers and so far, none of them match the Next button on Android.

This is what my code looks like:

<v-text-field
  label="My Input"
  class="input-field"
  v-model="myInput"
  @keydown="preventUnwantedEnterDefaultBehavior"
/>
...

private preventUnwantedEnterDefaultBehavior = (evt) => {
// none of these work for next
    if (evt.keyCode === 13 || evt.keyCode === 261 || evt.keyCode === 229 || evt.key === 'Unidentified') {
            evt.target.blur();
        }
}

Take note that the Next buttons default behaviour is to skip to the next input. I do not want this to happen. I want simple blur of the current input, regardless of what the Enter button is labelled as.

Alternatively, if this is really a near impossible task, how can I force the Android’s Next button to just be your good ol’ Enter button of code 13 as it on all the other platforms?

124 thoughts on “What is the keyCode from Android's Next button? (the one that sometimes replaces Enter)”

Leave a Comment