Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

can't tap on item in google autocomplete list on mobile

I'm making a mobile-app using Phonegap and HTML. Now I'm using the google maps/places autocomplete feature. The problem is: if I run it in my browser on my computer everything works fine and I choose a suggestion to use out of the autocomplete list - if I deploy it on my mobile I still get suggestions but I'm not able to tap one. It seems the "suggestion-overlay" is just ignored and I can tap on the page. Is there a possibility to put focus on the list of suggestions or something that way ? Hope someone can help me. Thanks in advance.

like image 522
Mike Äfer Avatar asked Apr 02 '12 06:04

Mike Äfer


People also ask

How does Google autocomplete this query?

Autocomplete predictions reflect real searches that have been done on Google. To determine what predictions to show, our systems look for common queries that match what someone starts to enter into the search box but also consider: The language of the query. The location a query is coming from.


1 Answers

There is indeed a conflict with FastClick and PAC. I found that I needed to add the needsclick class to both the pac-item and all its children.

$(document).on({     'DOMNodeInserted': function() {         $('.pac-item, .pac-item span', this).addClass('needsclick');     } }, '.pac-container'); 
like image 105
Space Devin Avatar answered Sep 18 '22 14:09

Space Devin