Tintef/react-google-places-autocomplete

onChange not working 3.4.0

eldan88 opened this issue · 6 comments

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'
                                            })},

                                    }}

/>

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

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.

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

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.

Hey.

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

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