Tintef / react-google-places-autocomplete

React Google Places Autocomplete input -- fully customizable
https://tintef.github.io/react-google-places-autocomplete
MIT License
371 stars 161 forks source link

onChange not working 3.4.0 #279

Closed eldan88 closed 2 years ago

eldan88 commented 2 years ago

Hi,

Below is the code i am using and the onChange event is not working..

<GooglePlacesAutocomplete   selectProps={{
                                        onChange: (res)=> {console.log(res)},
                                        placeholder: 'Enter Steet Address',
                                        className : "form-control border-0 shadow-0",
                                        components : {
                                        IndicatorSeparator: () => null,
                                            DropdownIndicator: () => null
                                    },
                                        styles : {
                                            control: base => ({
                                                ...base,
                                                border: 0,
                                                // This line disable the blue border
                                                boxShadow: 'none'
                                            })},

                                    }}

/>
Tintef commented 2 years ago

@eldan88 works fine for me. Is the google places script loaded?

eldan88 commented 2 years ago

No i didn't you put in your documentation

Note: if you pass down the apiKey prop to the component, you can skip loading the Google Maps JavaScript API, as the component will inject that script on the page.

eldan88 commented 2 years ago

I loaded the script its still not working....

Tintef commented 2 years ago

I cannot reproduce your issue, so there's not much I can do. If you want to share with me a repo or sth where the issue can be reproduced, I can take another look.

eldan88 commented 2 years ago

Hey.

I am using nextjs to implement this... it doesnt seem to output the log.. but on code sandbox its working fine...

eldan88 commented 2 years ago

Hey okay so for some reason dont know why it doesnt output it on the console log. Not for nexjs and not for a react app i have. Not sure why.

But it does work when i use alert()

Not sure why..