react-googlemaps icon indicating copy to clipboard operation
react-googlemaps copied to clipboard

Event listener on OverlayView and its children

Open ihat opened this issue 10 years ago • 2 comments

I'd like to register event listeners with elements contained within OverlayView. However, when I tried something similar to:

<OverlayView>
  <div onClick={onClickHandler} />
</OverlayView>

the event handlers don't actually receive the events. Is there a nice way to resolve this?

ihat avatar Feb 08 '15 09:02 ihat

@pieterv Any tips? Been banging my head against this. Thanks!

ihat avatar Feb 10 '15 03:02 ihat

Are you still having trouble with this? I had this issue open today as I coded up an OverlayView. I was worried about it. I didn't have any issue. My code looks something like:

<OverlayView>
  // ...
  <a onClick={this._handleThisParticularClick}>This Particular</a>
</OverlayView>

In the React component:

_handleThisParticularClick(e) {
  console.log('Works!');
},

And 'Works!' logs.

mileszs avatar Mar 12 '15 18:03 mileszs