Not sure if i’m focusing input (for purpose of showing keyboard) correctly – Getting inconsistent behavior with focus().
In config.xml
<preference name="KeyboardDisplayRequiresUserAction" value="false" />
<param name="ios-package" value="IonicKeyboard" onload="true" />
In my controller, I’m calling this function when controller is loaded, and it properly focuses the input box.
//focus decision name input
$scope.focusDecisionName = function () {
document.getElementById('decisionName').focus();
}
however, when i call it thereafter, like when the user tries to continue to the next screen without naming the decision, it doesn’t popup the keyboard again in the ios simulator. The alert displays correctly though. I assume i am correct in calling it on alert dismiss (alertPopup.then())
//alert if decision title is null
$scope.alertNullDecision = function() {
if($scope.decision.title == '') {
var alertPopup = $ionicPopup.alert({
title: 'Woah there!',
template: 'Please name your decision before continuing'
});
alertPopup.then(function() {
$scope.focusDecisionName();
});
};
}