react-places-autocomplete icon indicating copy to clipboard operation
react-places-autocomplete copied to clipboard

Is there a way to add to the suggestions?

Open dougschallmoser opened this issue 5 years ago • 2 comments
trafficstars

Has anybody been able to add a suggestion? Or better yet, I would like to implement "Current Location" as one of the suggestions when the search bar is clicked on, before the user types anything. Is this possible?

dougschallmoser avatar Nov 20 '20 01:11 dougschallmoser

I think you can use react state and you can modify it to your needs like this

({getInputProps, suggestions, getSuggestionItemProps, loading }) => {
   setSuggestionsState(prev => [..prev,...suggestions]);
}

mhesham32 avatar Mar 14 '21 14:03 mhesham32

@mhesham32 did you get a way to do it ? i am also looking for a way to add some Favorite addresses from my Db and the suggestions seem to be read only. @hibiken any ideas about extra user given suggestion renderings ?

sohrabch avatar Dec 23 '21 11:12 sohrabch