Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there an ability to make tooltip static and doesn't follow cursor? #76

Open
Karpengold opened this issue Nov 25, 2021 · 5 comments
Open

Comments

@Karpengold
Copy link

I would like to add some actionable items inside tooltip, but I can't interact with them cause tooltip follows cursor.

Is there ability to make tooltip static?

@vasturiano
Copy link
Owner

@Karpengold thanks for reaching out.

That's not supported by the module per se, but you can always create your own system of tooltips externally, using the onHover or onClick event handlers.

@Karpengold
Copy link
Author

@vasturiano Thank you for the answer. Maybe there is a chance that you have some kind of example of custom tooltip? I'm not sure that I understand how I can turn off default tooltip functionality and provide my own

@vasturiano
Copy link
Owner

@Karpengold I don't have an example of what you're looking for exactly, but you can basically disable the current default tooltip with .showTooltip(false), and then use onHover to code your own logic/placement for a tooltip element you control. The onHover method receives as argument the node object that's being currently hovered, or null if it's an hover out event.

@Karpengold
Copy link
Author

@vasturiano Thank you very much, I did it and it works well. Only one little thing that I found: if the mouse is moving really fast onHover effect is not triggered with null prop

@Karpengold
Copy link
Author

Also it would be nice to have Event object in onHover function :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants