Comments (19)
Is it possible to add type definitions to avoid adding declare module 'react-google-autocomplete'
to declaration file in Typescript projects?
from react-google-autocomplete.
I've been trying to implement enter press in the search field to select the first result if there is one, but I have not been able to achieve it.
from react-google-autocomplete.
Hey! I just published a new version(v2.1.0) which has denounce in it. Check it out and let me know your thoughts, thanks
from react-google-autocomplete.
@ErrorPro Can we please add debouncing capabilities here?
from react-google-autocomplete.
Thanks for maintaining! That one is still on my to-do list. I've got other, higher priority things right now, though. :(
from react-google-autocomplete.
Debouncing with ms as prop would be great. Can i make a PR for this feature?
from react-google-autocomplete.
First off: Thank you for a useful library!
I am working on an app that requires internationalization. Is it true to say the "Enter a location" language comes via the fact the Google Autocomplete Service is being used? If possible, having a means to pass through this language would be great.
from react-google-autocomplete.
Hi @ErrorPro, I'm working on trying to use the sessionToken inside usePlacesAutocompleteService.
I took a quick look at the code and couldn't figure out if it would update the session token at some point, because I believe a fresh session token is needed after each call to placesService.getDetails
It would be helpful to expose a refreshSessionToken() function or something if we need to do that ourselves.
Thanks!
from react-google-autocomplete.
Adding onChange would be really helpful to type an address that is not found by google.
from react-google-autocomplete.
Adding à value field which can be changed (i mean giving the possibility to manually set the value of the component)
from react-google-autocomplete.
Not sure if adding the onChange event listener would be feasible? Would help tremendously with manual input and client side form validation
from react-google-autocomplete.
@KoderMAL Please! Feel free to submit your PR and we can merge it
from react-google-autocomplete.
@rkyslyy Added TS annotations in v2 but thinking on rewriting the whole lib with TS later, also added TS info in the readme, please have a look!
from react-google-autocomplete.
Hey @ErrorPro, It would be super awesome and great if you add 'minChar'(minLengthAutocomplete) prop for <Autocomplete />
component, to reduce the amount of requests.
from react-google-autocomplete.
@nalezhytyi Hey! It's already built in the lib and provided by a hook called usePlacesAutocompleteService
which has debounce in it. Let me know if that's something you are looking for, thanks!
from react-google-autocomplete.
First off: Thank you for a useful library!
I am working on an app that requires internationalization. Is it true to say the "Enter a location" language comes via the fact the Google Autocomplete Service is being used? If possible, having a means to pass through this language would be great.
Hey, AFAIK google uses the current user's language by default to translate the texts but you can pass a language setting to it, let me know if that's something you can use
from react-google-autocomplete.
Hi @ErrorPro, I'm working on trying to use the sessionToken inside usePlacesAutocompleteService.
I took a quick look at the code and couldn't figure out if it would update the session token at some point, because I believe a fresh session token is needed after each call to placesService.getDetails
It would be helpful to expose a refreshSessionToken() function or something if we need to do that ourselves.
Thanks!
Hey, you are right regarding the use of session token, that would be indeed a good option to update the sessionToken
value. I will provide a way to update it, I have two options in mind:
- Add an overwrite(proxy) method for
placesService.getDetails
which would not only get the details but will also refresh the session token. Pros: done automatically ifsessionToken
prop presents, cons: you wouldn't have an option to do it yourself. - Add a method
refreshSessionToken
as you suggest which will re-generate the sessionToken whenever you call it. Pros: more flexible and gives more control over it, cons: you have to do it manually.
I am more inclined towards the first approach as it's more automatic and doesn't require knowledge about what/how/when refreshing the token. Any thoughts friends?
from react-google-autocomplete.
I just release v.2.6.0 with an additional method to refresh the session token, check the readme for more info
from react-google-autocomplete.
@ErrorPro plausible feature?
#154
from react-google-autocomplete.
Related Issues (20)
- Duplicated dropdown is rendered in `StrictMode`
- Type (inside options) is not working for ALL. Its work for city and region but not for ALL HOT 1
- Add criteria using the React Component
- Is it possible to change country dynamically? HOT 1
- Dynamically set defaultValue using place_id
- Autocomplete not Searching with Street Address or Number HOT 1
- Places API key restrictions
- How to verify if the input matches the selected address? HOT 3
- usePlacesAutocompleteService requests with combination of type "establishment" with any other type from table 2 always fails
- 'Autocomplete - Per Request' google cloud SKU is charged after setting sessionToken to true
- The selection is not maintained, only if I add code inside onPlaceSelected HOT 1
- how to change the zIndex in the pac-container HOT 3
- Package does multiple requests to Google Maps API for no reason
- google is not defined on NextJS production HOT 2
- How to style the Dropdown with google suggestions? HOT 1
- I can't make the `inputAutocompleteValue` param work
- onPlaceSelected not being executed HOT 1
- Adding form fields dynamically to the page
- Console warning: "Google Maps JavaScript API has been loaded directly without loading=async" HOT 7
- placesService.getDetails is undefined HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-google-autocomplete.