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.

hide tootip when click a button in ReactTooltip

See original GitHub issue

` <Icon name="email" data-tip data-for="GIN" data-event="click focus" />

      <ReactTooltip id="GIN" aria-haspopup="true" place="top" globalEventOff="click">

        <div>
          Resend confirmation email?
          <div className={styles.toolTipButton}>
            <Button type="primary" onClick={() => { ReactTooltip.hide(); }}>Yes</Button>
            <Button>No</Button>
          </div>
        </div>
      </ReactTooltip>`

when I click the yes button the tooltip doesn’t hide immediately. It just hide after i move the away from the button. it seems the ReactTooltop.hide() function doesn’t work.How can i hide the tooltip immediately when i click the yes button

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:5
  • Comments:14

github_iconTop GitHub Comments

17reactions
JesusJavierMorenocommented, Apr 15, 2019

Hello!

I dont know if you still ned it but I got it working this way.

image

I hope it works for you! 😄

16reactions
josh-stevenscommented, Jul 24, 2019

I had to do something similar and it’s a bit hacky, but it works with Typescript and React Hooks for the useRef:

Screen Shot 2019-07-24 at 2 34 10 PM

put the ref on the ReactTooltip:

Screen Shot 2019-07-24 at 2 35 06 PM

and this function for the close button inside the tooltip:

Screen Shot 2019-07-24 at 2 32 33 PM

It would be nice to disable the mouseover check in this lib so we don’t have to force this null, I will look into doing a PR if there’s any other demands for it

Read more comments on GitHub >

github_iconTop Results From Across the Web

hide tootip when click a button in ReactTooltip #449 - GitHub
You have to use the global ReactTooltip.hide() option instead of passing in the target ( ReactTooltip.hide(tooltip.current) ). That means that ...
Read more >
Close tooltip when clicking again on it in React - Stack Overflow
It should be closed when the button is clicked again but it seem to not work, it only closes when it is clicked...
Read more >
Show and Hide the Tooltip - DevExtreme - DevExpress
To show or hide the Tooltip programmatically, call the show() or hide() method. The same thing can be done using the toggle(showing) method....
Read more >
React Tooltip component - Material UI - MUI
The tooltip is normally shown immediately when the user's mouse hovers over the element, and hides immediately when the user's mouse leaves. A...
Read more >
Controlling tooltips & pop-up menus with components in React
isOpen and ; style states to show/hide and position the tooltip component respectively. Also, it is required to pass the ; () function...
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