Git Product home page Git Product logo

Comments (19)

rkyslyy avatar rkyslyy commented on July 19, 2024 5

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.

wjoeyu avatar wjoeyu commented on July 19, 2024 4

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.

ErrorPro avatar ErrorPro commented on July 19, 2024 4

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.

fabrianibrahim avatar fabrianibrahim commented on July 19, 2024 2

@ErrorPro Can we please add debouncing capabilities here?

from react-google-autocomplete.

chexxor avatar chexxor commented on July 19, 2024 1

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.

KoderMAL avatar KoderMAL commented on July 19, 2024 1

Debouncing with ms as prop would be great. Can i make a PR for this feature?

from react-google-autocomplete.

sasedlock avatar sasedlock commented on July 19, 2024 1

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.

p-young avatar p-young commented on July 19, 2024 1

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.

vrinceanuv avatar vrinceanuv commented on July 19, 2024 1

Adding onChange would be really helpful to type an address that is not found by google.

from react-google-autocomplete.

yamakhalah avatar yamakhalah commented on July 19, 2024

Adding à value field which can be changed (i mean giving the possibility to manually set the value of the component)

from react-google-autocomplete.

francoro93 avatar francoro93 commented on July 19, 2024

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.

ErrorPro avatar ErrorPro commented on July 19, 2024

@KoderMAL Please! Feel free to submit your PR and we can merge it

from react-google-autocomplete.

ErrorPro avatar ErrorPro commented on July 19, 2024

@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.

nalezhytyi avatar nalezhytyi commented on July 19, 2024

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.

ErrorPro avatar ErrorPro commented on July 19, 2024

@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.

ErrorPro avatar ErrorPro commented on July 19, 2024

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.

ErrorPro avatar ErrorPro commented on July 19, 2024

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:

  1. 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 if sessionToken prop presents, cons: you wouldn't have an option to do it yourself.
  2. 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.

ErrorPro avatar ErrorPro commented on July 19, 2024

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.

productpeter avatar productpeter commented on July 19, 2024

@ErrorPro plausible feature?
#154

from react-google-autocomplete.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.