Drives a controlled tooltip that opens on hover only when the trigger element's text is actually
truncated (its content overflows the visible box, i.e. scrollWidth > clientWidth). Useful for
revealing the full text of a label that uses CSS truncation, without showing a redundant tooltip
when the text already fits.
Attach the returned ref to the truncating trigger element, spread onPointerEnter /
onPointerLeave onto it, and pass open to a controlled Radix <Tooltip open={...}>.
Type Parameters
TextendsHTMLElement
The type of the trigger element (e.g. HTMLSpanElement, HTMLDivElement).
Drives a controlled tooltip that opens on hover only when the trigger element's text is actually truncated (its content overflows the visible box, i.e.
scrollWidth > clientWidth). Useful for revealing the full text of a label that uses CSS truncation, without showing a redundant tooltip when the text already fits.Attach the returned
refto the truncating trigger element, spreadonPointerEnter/onPointerLeaveonto it, and passopento a controlled Radix<Tooltip open={...}>.