I have been scratching my heads for the solution: the google maps autocomplete works fine when tested in browser, but does not work when in device. To elaborate, when I click on a suggestion popup for an address in the browser, the clicked address is automatically put into the text input box. However, when tested in device, clicking on a suggestion does not auto fill the input.
I have implemented the pac-item dom insertion fix and also the z-index fix, but none of them work. Any suggestion?
I am not creating a codepen because when seen in browser, things work just fine, but when deployed to device, only then this problem crops up.
bump
There are few threads about this issue on the forum-- This used to work with ionic pre-beta, not sure if this is on the radar for ionic devs, google’s autocomplete is a key feature in my app.
Exactly same thing happens with me. Weird thing is, I tried with two different OS versions of Samsung Galaxy S4, one with a custom ROM, other without, and it works on the regular rom but doesnt work on the custom rom. But dont get excited: it does not work on the ios simulator either. So definitely there is something that needs to be done from ionic’s perspective . Hope someone will find a solution.
btw. it works if you click/touch for two seconds.
(with the chrome dev tools device emulation: mousedown until the context menu gets triggered, then click again and the entry gets selected.)
Should we perhaps open an issue on github about this problem?
however, I am unable to get this to work in mobile (works fine in the web). Experiencing the same issue faced by ch000. Can anyone provide an update on this? Is there a fix available for this?
This is preventing me from using ngAutocomplete to implement google places autocomplete in my mobile app.
I have the latest ionic *** beta.11, and on browser fine, but on iPhone viewing the same content in the iPhone safari browser I am unable to select address from Google Popup.
While digging into it, where on one side iOS simulator and another connected safari debugger I found following and maybe somebody more javascript/ css experienced might tell why.
I can make it every time work if I do several manual steps in debugger:
Make sure that this .pac-container has style *pointer-events set to auto/all [on modal we have none]
The div.pac-container has set data-tap-disabled to true
- Here the disableTab directive did not work for me since it was executed and this google container was not present in DOM yet.
- I think better put this code from disableTab into ngAutocomplete code. At some point it always there + I would search for .pac-item and then go up to parent - to be sure I have the active container.
Once you select a item from popup and CLICK MANUALLY on KEYBOARD DONE [to hide it] the item is selected and set correctly.
And this keyboard is probably the main issue for me now considering that I can deal with data-tap-disabled
I saw that there is some custom ionic touch event handling and it could be the issue in this one ?
I see the item from popup is selected But keyboard is still available it does not hide itself after I click. if I hide it manually the ngAutocomplete retrieve correct data.
Now it works for me, if I follow workaround I described.
Select item , then manually hide keyboard.
The place to add setting datatabdisabled I am hacking directly in the code just before I show modal dialog with slide box.
even I do not like the solution but it works I am not so skill angular user nor ionic, but this was first that worked for me. I am sure that might be something nicer. I need to learn about directives maybe there is a away to have directive directly on the input field that is executect at the time input field is rendered and here you modify the pac container.
This is more angular question then then ionic ;-). and My level is not that great to support angular…
So to help also other that my join this discussion, what is your issue then ?
This is what I described earlier. You select an item and then you have to manually hide keyboard. As workaround it works. Once you close keyboard the ngAutocomplete will be fired you get your data.
There is somem issue in IONIC.
When you track this down, when you click on the item you can see it normally files
touchStart, and etcs… but its gets eaten by ionic and nothing.