Issue
Having an input field like:
<input type="text" />
Will automatically (on Android) change the Enter
option on you keyboard to Next
, so it will jump to the next field.
How to avoid this behaviour?
In my case I'm using an input field to add tags to (or Chips
), which works fine on mobile because the appropriate event is fired, but when the next
button only seems to simulate pressing tab
on your keyboard, i.e. it goes to the next field.
(Also can't find any relevant specs on this keyboard displaying behaviour, it seems to be a free-formed android specific thing)
Solution
One solution or workaround is to set the type to search
:
<input type="search" />
It's a bit odd to have to press a magnifying glass to add a tag in my usecase, but it works. And any of the other property values don't seem to produce the same result as I want: https://www.w3schools.com/html/html_form_input_types.asp
Like submit
will trigger submitting the form, not the field, afaik.
Answered By - TrySpace
Answer Checked By - Marilyn (JavaFixing Volunteer)