我正在使用AngularJS开发Ionic App.
我得到了很少的输入(登录/注册的东西),当按下Enter键时 - 在Android上的按钮和iOS上的等效按钮 - 也就是说KeyCode 13,它通过自定义指令专注于下一个输入.
它在网络浏览器上运行得非常好,但在手机上,它会聚焦下一个输入,然后焦点会立即丢失,键盘会自行隐藏,迫使用户再次点击输入.
这是HTML:
<ion-view title="First Screen" hide-nav-bar="true" id="firstScreen" class=" ">
<ion-content padding="false" style="background: url(img/XAYpMMdUTvWFVAnrEhUi_restaurant.jpg) no-repeat center;background-size:cover;" class=" manual-remove-top-padding" scroll="false">
<div class="">
<img src="img/awdYDbeeSlSHCToXN5Lw_logo.png" width="auto" height="30%" style="display: block; margin-left: auto; margin-right: auto;">
</div>
<label class="item item-input " id="emailInput" name="email">
<input class="invisible-input" type="email" placeholder="Email" ng-model="user.email" focus-me="currentInput == 0" ng-keyup="inputKeyEvent($event, 0)">
</label>
<label class="item item-input " id="passwordInput" name="password">
<input class="invisible-input" type="password" placeholder="Mot de passe" focus-me="currentInput == 1" ng-model="user.password" ng-keyup="inputKeyEvent($event, 1)">
</label>
<label …Run Code Online (Sandbox Code Playgroud)