svelte-use-tooltip
svelte-use-tooltip copied to clipboard
Position tooltip regarding window boundaries
The position of the tooltip is defined by the developer and is fixed wherever is the target inside the screen so far.
It would be nice to keep that behaviour by default and allow to automatically re-position the tooltip if it is not visible because of the parent element or the screen boundaries.
For example, if the position is set to right
and the target is stuck against the window right boundary, we'd like to change the position to left
.
The convention might be to re-position the tooltip to the opposite side.
I can't see any usecase for having a prop to force the position even if the tooltip is not visible.