I have a change event on a select that should focus on the next input (text input) and select all its text. I tried:
$('#myselect').change(function () {
//Doing some extra operations
var $hours = $('#myinput');
$hours.focus(function () {
this.setSelectionRange(0, 999);
})
$hours.focus();
}
This works perfectly on desktop (tested on chrome) but not completely in safari (tested on iphone 5s and ipad2).
In particular, the input gets the focus, but the keyboard doesn't open, and if I click elsewhere then the keyboard opens and the text inside the input is selected.
How can I fix this?