Focusable wrapper that lets a DISABLED control still host a tooltip.
A disabled button is removed from the tab order and (in most browser/AT combinations) does not
fire the pointer and focus events Radix's Tooltip listens for — so the one moment the user most
needs the explanation ("why can't I use this?") is the one moment the button cannot deliver it.
Wrapping the control in a focusable, named element restores it: the wrapper takes the tooltip
trigger's place in the tab order and carries the explanation as its accessible name, so keyboard
and screen-reader users reach the same information pointer users get on hover. While the control
is ENABLED the wrapper is inert — no role, no tab stop, no name — leaving the button itself as
the single focusable, named thing.
Render it as the asChild child of a TooltipTrigger; it forwards the trigger's props and ref
onto its div. DisabledActionTooltip composes this with the rest of the Tooltip shell for
the common case of one tooltip message driving both the accessible name and the tooltip body.
Focusable wrapper that lets a DISABLED control still host a tooltip.
A disabled button is removed from the tab order and (in most browser/AT combinations) does not fire the pointer and focus events Radix's
Tooltiplistens for — so the one moment the user most needs the explanation ("why can't I use this?") is the one moment the button cannot deliver it. Wrapping the control in a focusable, named element restores it: the wrapper takes the tooltip trigger's place in the tab order and carries the explanation as its accessible name, so keyboard and screen-reader users reach the same information pointer users get on hover. While the control is ENABLED the wrapper is inert — no role, no tab stop, no name — leaving the button itself as the single focusable, named thing.Render it as the
asChildchild of aTooltipTrigger; it forwards the trigger's props and ref onto itsdiv.DisabledActionTooltipcomposes this with the rest of theTooltipshell for the common case of one tooltip message driving both the accessible name and the tooltip body.