core icon indicating copy to clipboard operation
core copied to clipboard

Feature Request: Tooltip Multi-Target Support

Open AllanKerr opened this issue 5 years ago • 0 comments

Tooltip Multi-Target Support

What do we want to do?

Allow tooltips to have multiple targets so that hovering / focusing any of the targets will trigger the tooltip. Changing for to support multiple targets like for="id1 id2 id3 id4" would allow for this.

Why do we want to do this?

In some cases it makes more sense to display a single tooltip for multiple elements rather than a tooltip for each. Currently this can be done but it requires manually handling events for anything that isn't the tooltip's target and calling show() / hide().

multitarget

What challenges are involved?

The primary challenge is how to position the tooltip relative to multiple targets.

Option 1:

Compute the smallest rectangle that includes all targets. This will likely result in good positioning but might cause issues where the pointer doesn't point to any of the targets.

Option 2:

Always position relative to the first target and only use the others for focus / hover events.

AllanKerr avatar Aug 10 '20 17:08 AllanKerr