Skip to content

Commit

Permalink
adds more context to a11y issues with the tooltip implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
mperrotti committed Jul 25, 2022
1 parent b3d1e82 commit 891e357
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/SegmentedControl/SegmentedControlIconButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ const SegmentedControlIconButtonStyled = styled.button`
// TODO: update this component to be accessible when we update the Tooltip component
// - we wouldn't render tooltip content inside a pseudoelement
// - users can pass custom tooltip text in addition to `ariaLabel`
//
// See Slack thread: https://github.slack.com/archives/C02NUUQ9C30/p1656444474509599
//
export const SegmentedControlIconButton: React.FC<SegmentedControlIconButtonProps> = ({
'aria-label': ariaLabel,
icon: Icon,
Expand All @@ -46,7 +49,7 @@ export const SegmentedControlIconButton: React.FC<SegmentedControlIconButtonProp
':not(:last-child) button': borderedSegment
}}
>
<SegmentedControlIconButtonStyled aria-pressed={selected} sx={mergedSx} {...rest}>
<SegmentedControlIconButtonStyled aria-label={ariaLabel} aria-pressed={selected} sx={mergedSx} {...rest}>
<span className="segmentedControl-content">
<Icon />
</span>
Expand Down

0 comments on commit 891e357

Please sign in to comment.