Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InfoBox children with onClick event #399

Closed
mychalvlcek opened this issue Dec 6, 2016 · 2 comments
Closed

InfoBox children with onClick event #399

mychalvlcek opened this issue Dec 6, 2016 · 2 comments

Comments

@mychalvlcek
Copy link

mychalvlcek commented Dec 6, 2016

Anyone experiencing issue with adding onClick event to InfoBox children?

import InfoBox from 'react-google-maps/lib/addons/InfoBox';

<InfoBox>
    <div onClick={() => {console.log('clicked')}}>
        lorem ipsum
    </div>
</InfoBox>
@mychalvlcek mychalvlcek changed the title InfoBox children onClick event InfoBox children with onClick event Dec 6, 2016
@mychalvlcek
Copy link
Author

ok i figured it out.. the problem wasnt here but in infobox library (https://github.com/lucasfs7/google-maps-infobox-module)

solution: infobox has disabled mouse event propagation by default..
so just set it up by option enableEventPropagation

const infoBoxProps = {
    position: new google.maps.LatLng(1,2),
    options: {
        enableEventPropagation: true
    },
};

<InfoBox {...infoBoxProps}>
    <div onClick={() => {console.log('clicked')}}>
        lorem ipsum
    </div>
</InfoBox>

@tomchentw
Copy link
Owner

Please refer to Getting Help section in the README (or #469).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants