3
Currently I have the following block attached to user action.
$(".class-botao").focus()
When the user interacts with the page the mobile keyboard is displayed normally.
However in my application there is a method that checks if there is any empty input when loading the page and if there is one .focus()
in the element;
autoFocus: function(scope) {
var firstInput = $('.class-input.empty:required').filter(':first:visible');
if (!firstInput.length) {
return false;
}
firstInput.focus();
return true;
},
Everything works normally but the keyboard does not appear (IOS/Android),
I’ve tried to simulate events .trigger('click // touchstart')
shortly after the focus()
, but nothing on the keyboard :/
Does anyone have any tips ?
"However in my application there is a method that checks if there is any input vázio when loading the page", Is this your method? If yes, ask the question and someone will help you
– Klaider
Edited friend, Rigadão by tip :)
– Douglas Neves
Puts tbm relevant html and css for verifying functionality. Reading your function seems to me to be ok, but you are sure that firstInput is getting only one element and not a collection containing only one item?
– Leandro Angelo