You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to show the menu with place suggestions already when the input is focussed, not just after the user typed something. I tried using defaultOptions: true as part of selectProps, which is almost what I want. However, it only works with the initial value and does not update the suggestions when the input is blurred and focussed again.
I am using the component as a controlled input, something like this:
Type "London", suggestions for "London" are shown.
Blur the input - input value stays "London" and menu closes.
Focus input again - suggestions for "Paris" are shown, but input value is "London". I would like to show suggestions for "London" instead.
I hope I didn't miss anything, but I tried quite a few combinations of props without any success.
Suggestions
I found this issue with a suggested solution in react-select, which pretty much describes my use case: JedWatson/react-select#1525 (comment). However, I was not able to utilise this approach because I do not have access to the loadOptions function that is used by react-google-places-autocomplete. So an option could be to make this available as part of the library.
Alternatively, maybe there could be an option added to the GooglePlacesAutocomplete component, which would obviously more convenient.
The text was updated successfully, but these errors were encountered:
Problem
I want to show the menu with place suggestions already when the input is focussed, not just after the user typed something. I tried using
defaultOptions: true
as part ofselectProps
, which is almost what I want. However, it only works with the initial value and does not update the suggestions when the input is blurred and focussed again.I am using the component as a controlled input, something like this:
The behaviour is as follows:
I hope I didn't miss anything, but I tried quite a few combinations of props without any success.
Suggestions
I found this issue with a suggested solution in
react-select
, which pretty much describes my use case: JedWatson/react-select#1525 (comment). However, I was not able to utilise this approach because I do not have access to theloadOptions
function that is used byreact-google-places-autocomplete
. So an option could be to make this available as part of the library.Alternatively, maybe there could be an option added to the
GooglePlacesAutocomplete
component, which would obviously more convenient.The text was updated successfully, but these errors were encountered: