Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ios 10 autofocus not focusing input

When i'm running an application on Desktop or Android device, input focus is working fine. But it's not working in ios 10 Safari. I am using angularjs.

$timeout(function () {
  var input = $element.find('.my-input-box')[0];
  input.focus();
}, 500);
like image 946
Rohit Avatar asked Feb 24 '17 06:02

Rohit


1 Answers

Since you are using angularjs, you should definitely try finding your solution in angular.

Did you try using ngFocus.

I guess it would probably look like this:

html:

<input ng-focus="YourVariable">

And set YourVariable to True.

like image 58
mlk Avatar answered Sep 17 '22 11:09

mlk