Short version:
I'm using google's autocomplete places from the Google Places Library (here https://developers.google.com/maps/documentation/javascript/places) and I need to tell when a user has selected a place from the auto-complete list and when they have clicked elsewhere, tabbed out, etc.
My goal is to run a function when a user interacts with the input element but does not select an autocomplete option.
More details:
In looking at the documentation, it appears the only event is fired when (really, if) the places change, which happens after a (potentially long) server round trip. If the user doesn't select anything from the list, that event is never fired. (Docs at https://developers.google.com/maps/documentation/javascript/reference?hl=fr#Autocomplete)
I can attach a listener to the blur event for the input element the autocomplete attaches to, but the problem is that the blur event happens well before the places_changed event happens.
So far have tried a number of things including listening for events on the autocomplete suggestions with something like the following:
$('body').on('click', '.pac-item', function(){alert.log('yay!');});
the google library apparently eats the events though.
Any help would be greatly appreciated.
Thanks!