compound-web
ed4b75f7 - Enable tooltips to be used as accessible labels

Commit
1 year ago
Enable tooltips to be used as accessible labels Currently, the only use case that our tooltip component supports is to describe another element. But it's arguably far more common in our products to use tooltips as an accessible label for an icon. I propose we change the default behavior of <Tooltip label={...}> to be that of a persistent accessible label, and use <Tooltip description={...}> for descriptive tooltips. I took the liberty of changing the tooltip tests to use targeted assertions rather than snapshots, because in theory this makes for a less noisy test suite that is also better at communicating what properties we actually expect tooltips to have.
Author
Committer
Parents
Loading