calebjacob / tooltipster

A jQuery tooltip plugin
MIT License
2.76k stars 480 forks source link

Solution for a proxy-like element (i.e preview cells in a datagrid) #745

Closed danielgindi closed 5 years ago

danielgindi commented 6 years ago

Hi!

There's a specific use case that I had difficulties with and had to add a lot of hacks to solve, but if the library supported it out of the box it would be much easier.

The situation is where we have a "preview cell" showing in a data grid, so when hovering on the cell which has a tooltipster set up, the preview cell shows up immediately because it was clipped. No what happens is that the tooltipster detects a mouseleave and hides. If I'll set it up on the preview cell's element, it will have problems in interactive mode, because dragging the mouse to the tooltip will hide the preview, and the garbage collector detects that the preview cell was removed.

A possible solution for this is to add some kind of a callback to inform if the element that the mouseleave detected is a legitimate "parent" of the tooltip, in that case it wouldn't hide - but will register for mouse events on the new element too.

What do you think?

louisameline commented 5 years ago

Hello, thank you for your message. The dismissable event might help you, check the source code for explanations. It's half way between the built-in triggers (which you can prevent via a callback if you wish), and full manual control through the methods.

louisameline commented 5 years ago

If that's not enough, I personnaly wouldn't add more features for these use cases, as everyone has a different situation, and methods are here for that really.