element-hq / compound

Element's design system
https://compound.element.io
Apache License 2.0
12 stars 3 forks source link

Tooltips in Compound Web should rely on a global provider #234

Closed robintown closed 10 months ago

robintown commented 1 year ago

Currently, if you hover over a series of tooltip elements, you can observe that there is a delay incurred every time before the tooltip appears:

Screencast from 2023-10-03 09-52-09.webm

It would be nice if this delay could be removed when hovering over further tooltip triggers, after the initial "warm-up" period. Radix tooltips do actually implement this behavior (see the skipDelayDuration prop in the tooltip docs), but because we mount a separate tooltip Provider for every tooltip, this "warm-up" state isn't shared across tooltips. To fix this, we should require consumers to wrap their application in a global Provider, and remove it from the individual tooltip component instances.