Javascript Ionic iOS键盘显示问题
HTML: 我想在输入后立即显示键盘。它不能在浏览器上工作 在ionic应用程序中,我使用以下配置: config.xmlJavascript Ionic iOS键盘显示问题,javascript,angularjs,iphone,ionic-framework,mobile-safari,Javascript,Angularjs,Iphone,Ionic Framework,Mobile Safari,HTML: 我想在输入后立即显示键盘。它不能在浏览器上工作 在ionic应用程序中,我使用以下配置: config.xml app.controller("EntryController", function($scope, $timeout, $http){ //this binds the event when *Done* is pressed on keyboard mobile iOS browser $timeout(function(){
app.controller("EntryController", function($scope, $timeout, $http){
//this binds the event when *Done* is pressed on keyboard mobile iOS browser
$timeout(function(){
var entryElement = document.getElementById('txtEntryInput');
if(entryElement) {
entryElement.addEventListener('focusout', function (e) {
$scope.someActionOnEnter();
});
}
});
$scope.someActionOnEnter = function(){
//some ajax call dummy
$http({}).then(function(){
//this is not focusing on element and not showing keyboard on mobile safari, on android it is working
$timeout(function(){
$('#txtEntryInput').focus()
});
});
};
});
感谢您的帮助,我想在输入后立即显示键盘
app.controller("EntryController", function($scope, $timeout, $http){
//this binds the event when *Done* is pressed on keyboard mobile iOS browser
$timeout(function(){
var entryElement = document.getElementById('txtEntryInput');
if(entryElement) {
entryElement.addEventListener('focusout', function (e) {
$scope.someActionOnEnter();
});
}
});
$scope.someActionOnEnter = function(){
//some ajax call dummy
$http({}).then(function(){
//this is not focusing on element and not showing keyboard on mobile safari, on android it is working
$timeout(function(){
$('#txtEntryInput').focus()
});
});
};
});
<preference name="KeyboardDisplayRequiresUserAction" value="false" />
$timeout(function () {
if (window.cordova && window.cordova.plugins && window.cordova.plugins.Keyboard) {
cordova.plugins.Keyboard.show();
}
}, 100);