I am using jQuery UI autocomplete (the default functionality), but I am facing a problem in iOS - I need to tap two times to select an option. I am using it with Bootstrap inside a modal window. Is there any solution for this?
Asked
Active
Viewed 3,271 times
5
-
1I had the same problem. This answer helped me to solve it: http://stackoverflow.com/a/27622899/2940802 – José Antonio Postigo Apr 22 '15 at 12:51
-
Thanks Jose...I solved this by changing jQuery UI version. – Bryce77 May 06 '15 at 20:19
1 Answers
2
I have the same problem solved it by using the Focus event. First detect that they are on a touch device. You can expand on the user agents below for a more complete list.
And then doing whatever you are doing inside the select event. This will redirect them with one tap.
focus: function (event, ui) {
if (navigator.userAgent.match(/(iPod|iPhone|iPad)/)) {
window.location.href = ui.item.url;
} else{
$('#SearchTerm').val(ui.item.label)
}
}

Darryl Windsor
- 79
- 1
- 4