cedricdelpoux/react-google-places-suggest

Triggering geo-coding on “enter”

Cammac7 opened this issue · 1 comments

The google maps auto-suggest api has become a bit aggressive, so it now always shows suggestions even when a unit number is put in that stops any of the suggestions from matching the input string.
The result of this is that when users hit return on an address with a unit number (I.e. 123 Main Street. Apt 12, Springfield Illinois) it gets mapped to 123 Main Street, Springfield Illinois (it gets rid of the unit number).

I’d like to trigger the handleNoResult function if the user hits return without clicking/selecting one of the suggestion options. This would allow me to call the geocodeAPI with the string, which would return the location including the unit number.
Is there a way to stop return from selecting the first autosuggestion and instead call the handleNoResult function?

Ended up switching to the SearchBox api to solve this