question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

div onClick is not firing inside React tooltip container

See original GitHub issue

I am using react tooltip container, where I have a div inside react tooltip container. upon clicking a div it should do some actions. but the facing an issue here seems the onClick listener isn’t working inside react tooltip.

My code sample:


const getSomething = () => {
    return (
      <div onClick={() => console.log('Hello world')}>
        Hellow orld
      </div>
    )
  }

<ReactTooltip
    id="actions"
    effect="solid"
    clickable="true"
    className="container"
    globalEventOff="click"
    ref={ref => this.tooltip = ref}>
    {
      getSomething()
    }
</ReactTooltip>

The onClick is not firing inside the tooltip container. Let me if I’m missing something. Thanks in advance 😃)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
sgurillocommented, Nov 2, 2021

@zakariaelas yeah it does! Thank you so much dude!

1reaction
zakariaelascommented, Nov 2, 2021

Hey @sgurillo, does this solve your problem https://codesandbox.io/s/gifted-parm-42xel ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

div onClick is not firing inside React tooltip container #711
I am using react tooltip container, where I have a div inside react tooltip container. upon clicking a div it should do some...
Read more >
onclick in tooltip not firing - Stack Overflow
I'm trying to get an onclick event to fire when the user clicks on the large pink button inside the tooltip.
Read more >
Open Mode in React Tooltip component - Syncfusion
Custom, Tooltip is not triggered by any default action. So, you have to bind your own events and use either open or close...
Read more >
Controlling tooltips & pop-up menus with components in React
Although I call it tooltip, it can be anything that you want to display when an element inside the DOM is interacted with...
Read more >
react-big-calendar onclick event - You.com | The AI Search ...
It's because the returned Modal component was never attached to the DOM. Try changing your implementation by conditionally rendering the Modal instead.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found