$ionicPopup not autofocusing on first input (mobile Safari)


#1

Simple $ionicPopup is not auto-focusing on the input in mobile safari. Works correctly on desktop Safari.

	var myPopup = $ionicPopup.show({
	   template: '<input type="tel" autofocus="true">',
	   title: 'Enter Odometer Mileage',
	   scope: $scope,
	   buttons: [
		   { text: 'Cancel' },
		   {
			   text: '<b>OK</b>',
			   type: 'button-positive',
		   }
	   ];
        });

The modal pops up correctly, but I must manually click into the field to focus it.


#2

This works when combined with cordova to make an hybrid app. As far as mobile safari goes, you may not have the same permissions, such as being able to trigger the keyboard to show with out user input.


#3

I tried this in ios emulation and am not getting focus on the input. Is there a way to submit a sample app for you to verify this bevahior?


#4

For it to work with cordova you need to add this in your config.xml

<preference name="KeyboardDisplayRequiresUserAction" value="false" />

#5

i try this , but it doesn’t works for me


#6

@areschen, is this in mobile safari or on a native app?


#7

now it’s ok in native .