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:
- Created 5 years ago
- Reactions:5
- Comments:14
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hello!
I dont know if you still ned it but I got it working this way.
I hope it works for you! 😄
I had to do something similar and it’s a bit hacky, but it works with Typescript and React Hooks for the useRef:
put the ref on the ReactTooltip:
and this function for the close button inside the tooltip:
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