I need to focus on an input as soon as it becomes visible (AngularJS).
I used ng-attr-autofocus
to do so.
<input ng-attr-autofocus="{{SOME_SCOPE_VARIABLE}}">
It works great, accept for IOS devices.
I realized that IOS developers "canceled" the behavior of .focus()
function.
I can't find a way to focus, I tried adding directives and many other methods I came across to, no success. (I need to do it to make the keypad visible)
EDIT: PHP
config.xml
<preference name="KeyboardDisplayRequiresUserAction" value="false" />
home.html
<input type="text" auto-focus>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.