I have a dirt simple template where I am showing a bunch of inputs. When I transition to this state, for some reason Cordova auto focuses on an input field and brings up the keyboard.
I randomly put a ui-sref on an image element further up the page on the previous template, and the issue went away.
It turns out that the input auto-focusing is not an auto-focus but rather a lingering touch from the previous state. The input I thought was auto-focusing just happens to be placed on the same relative location as the link on the previous template.
So I touch a link with a ui-sref in one state, and the same touch event is focusing on an input in the next state.
I don’t know if you’ve found a solution yet, but disabling tap on the offending button does work to fix the problem for me, but I think another workaround might be to have a transparent overlay div that blocks input on page you’re transitioning to that gets hidden/removed once the transition is over. I have yet to try it but I’m guessing the problem is the animation of the transition is causing some goofiness in the tap detection. I’m thinking in your view controller you do something like
$scope.$on('$ionicView.afterEnter', function () {
$scope.showTapBlock = false; // this variable controls ngShow/Hide?
});
I have been having the same issue on iOS devices :
It turns out that the input auto-focusing is not an auto-focus but rather a lingering touch from the previous state. The input I thought was auto-focusing just happens to be placed on the same relative location as the link on the previous template
If anyone needs an other workaround, here’s mine :
on the form html tag, I added ng-if=“!tapBlocked”
in my controller, I added the following lines :
$scope.$on(‘$ionicView.beforeEnter’, function () {
$scope.tapBlock = true;
});
I have 2 tabs both included some textareas, when switiching tabs there will come up an popup, asking the user if he really wants to leave.
After click on okay (okay was at the same position than the textarea of the other tab). sometimes… the keyboard opened and jumped into the textarea, sometimes the keyboard opens without any focus and sometimes the keyboard did not open…