React-tooltip: onClick not getting fired

Created on 20 Jun 2017  路  2Comments  路  Source: wwayne/react-tooltip

Hi guys, I tried to apply your amazing library to my project, however, I am running into the issue of not one of the onClick is getting fired in the following code. Could you guys give me some hints? Thanks in advance!

<div className="App-intro">
  <a
    data-tip
    data-for="demo"
    onClick={() => {
      console.log('A clicked');
    }}
  >
    <FontAwesome
      name="share"
      onClick={() => {
        console.log('Share Clicked');
      }}
    />
  </a>

  <ReactTooltip
    id="demo"
    event="click"
    onClick={() => {
      console.log('Tooltip Clicked');
    }}
    aria-haspopup="true"
    offset={{ right: 5 }}
    effect="solid"
  >
    <p>Copied!</p>
  </ReactTooltip>
</div>

Most helpful comment

Hi

I was facing the same issue, in my case I wanted to close the tooltip with a button inside the tooltip. I passed the option isCapture as true and now it is working, I'm not sure why, maybe when you specified the event='click' the clicks are being capture by the tooltip and the others listeners don't fire.

Cheers

All 2 comments

Hi

I was facing the same issue, in my case I wanted to close the tooltip with a button inside the tooltip. I passed the option isCapture as true and now it is working, I'm not sure why, maybe when you specified the event='click' the clicks are being capture by the tooltip and the others listeners don't fire.

Cheers

@netoho Awesome, it works! Thank you so much!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Ericky14 picture Ericky14  路  3Comments

alex6633 picture alex6633  路  3Comments

antofa picture antofa  路  4Comments

tonynd picture tonynd  路  3Comments

kristinadarroch picture kristinadarroch  路  3Comments