Skip to content

Commit

Permalink
fix: Fix accessibility tooltip bug (#2446)
Browse files Browse the repository at this point in the history
Fixes: #2405

Describe tooltip type will have `aria-label` on target too

[category:Components]
  • Loading branch information
RayRedGoose authored Dec 5, 2023
1 parent 9142d8d commit 7842bc5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/react/tooltip/lib/Tooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export const Tooltip = createComponent('div')({
{React.cloneElement(children, {
...targetProps,
...mergeCallbacks(children.props, targetProps),
...(type === 'muted' && children.props['aria-label']
...(/^(muted|describe)$/.test(type) && children.props['aria-label']
? {'aria-label': children.props['aria-label']}
: {}),
})}
Expand Down

0 comments on commit 7842bc5

Please sign in to comment.