You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
🐛 [BUG] - Tooltip adds role="tooltip" to description tooltips #1509
When Tooltip uses its default type="description", the tooltip element is rendered with role="tooltip", in addition to being associated with the trigger via aria-describedby.
Screen reader support for role="tooltip" is limited and inconsistent; GitHub's accessibility guidance for github.com recommends against using it for that reason. The trigger's aria-describedby association already exposes the tooltip text as the trigger's accessible description, so the role adds little for assistive technology users while making it harder for consumers to meet that guidance.
For context, the WAI-ARIA APG tooltip pattern does use role="tooltip", but that pattern is still marked as work in progress without task force consensus.
Version: @primer/react-brand 0.79.0 (esm/Tooltip/Tooltip.js: role: type === "description" ? "tooltip" : undefined). This also affects components that use Tooltip internally, such as PricingOptions.FeatureListItem with the tooltip prop.
Reproduction steps
1. Render <Tooltip text="Includes 3,000 minutes per month."><button>Info</button></Tooltip> (default type="description")
2. Focus or hover the trigger
3. Inspect the tooltip element in the DOM
4. See role="tooltip" on the tooltip, with the trigger referencing it via aria-describedby
Expected behavior
1. Description tooltips rely on the trigger's aria-describedby association without adding role="tooltip"2. Alternatively, the role is opt-in so consumers can follow their own accessibility guidance
Activity