Input type="number" submit on enter

When using a text input on my Android phone, pressing the Enter button triggers ng-submit of the parent form or if I were to use ng-keypress on the input itself I am able to monitor $event.which == 13.

When I change this input type to “number” and press the Enter button when the soft keyboard is open, both ng-submit and ng-keypress return no sort of event as if the Enter button is bound to “Close Keyboard”

Is there a work around for this? I’d like to keep with input type=“number” because of the more relevant keyboard.


It feels wrong but if anyone has had similar issues I’ve currently gone with the following, I have an invisible button straight after the number input and when it gets focus it runs the relevant scope function

<input type="number" ng-model="quickID" class="search-header-input" placeholder="Quick Nav Call ID" />
<button ng-focus="cheatQuickNav();" style="opacity: 0; width: 0px; height: 0px;"></button>

For whatever reason, the number keyboard of Android presents a “Next” button and not a “Done” button, I don’t see why, but there we go, I think it’s a general bug.

1 Like

Do you have a form around the input-element?

I did attempt having a form around the element and using ng-submit, but the number input wasn’t firing.

Is there a more graceful solution?


Okay i tested it and on Android 5.0 the done button does not work as expected.

You are right mit the better keyboard, but i would do something like that: