Hacker News new | ask | show | jobs
by johtso 304 days ago
Think a common approach is to just display a triangular svg beneath the tooltip:

https://react-spectrum.adobe.com/react-aria/Tooltip.html#exa...

1 comments

> Think a common approach is to just display a triangular svg beneath the tooltip

One killer feature of CSS anchor positioning is that it allows you to declaratively define fallback positions if the floating element does not fit into the preferred position. For example, you prefer your tooltips to appear below the anchor; but if the anchor happens to be at the bottom of the screen, there is no space below it, and so the floating element can flip to the top.

After the flip, the triangular svg will be pointing in the wrong direction.