Open tilersmyth opened 6 years ago
@tilersmyth Hi! Did you find any solution to getting the event without changing the react-places-autocomplete?
hey @SmirnovW , I ended up bailing on react-places-autocomplete. creating my own solution (while using this project as a reference) turned out to be easier than I thought it would be...
@tilersmyth Thank you for the feedback!
Hi @tilersmyth , can you share a link to your project? I'm facing a similar issue where I need the event thrown by the input element.
@griffith-icp
I was looking for an autocomplete solution in a setup wizard. My memory is a little foggy on the specifics but you can probably deduce what I did by looking here:
Yeah thanks @tilersmyth . I found a way out. I plan on cloning this repo, fix a few bugs and host it on npm. Because it's really don't know why the event object wasn't being bubbled up. (I only had to change a few lines in the library)
I found a work around
<Select {...getInputProps({ onSearch: value => getInputProps().onChange(event = { target: { value } }) })} />
don't know if its a good solution but its working
I'm having the same issue. Not quite sure how to implement these work arounds. Any fixes yet?
Do you want to request a feature or report a bug? featurish What is the current behavior? onChange assumes event as variable If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. n/a What is the expected behavior? Hoping onChange can accept value Which versions of ReactPlacesAutocomplete, and which browser / OS are affected by this issue?
@hibiken - I am hoping to use this project with the select component from Ant Design. That component's onChange returns the input's value by default (as opposed to the input event). Just to get it working, I went into PlacesAutocomplete.js and added the below code inside the handleInputChange function (line 225):
var value = event.target ? event.target.value : event;
Is there an intended method to handle this scenario in the current project or not at this time?
Thanks for the help/insight.