I have some hardware sending input to my app, either by Bluetooth or wired hardware keyboard. At the moment I have a text field taking the input. I need the field to auto-focus when the screen loads, but without haivng the soft keyboard popup on focus.
I've tried autofocus attribute for HTML, but it messes with the view when I'm using Ionic.
I also tried using an angular directive, to focus after 500ms.
.directive('focus', function($timeout, $parse, $cordovaKeyboard) {
return {
restrict: 'A',
link: function(scope, element, attrs) {
$timeout(function() {
element[0].focus();
}, 500);
}
}
})
Is there a way of focusing without the soft keyboard displaying in both iOS and Android? I need the soft keyboard to popup only when the user clicks on the input field manually.
The other option would be to have a listener for any hardware keyboard inputs - but I can't see any way to do this in Cordova.