Skip to content

Commit

Permalink
fix: Tooltip example should rely on relationship, not aria-labelledby. (
Browse files Browse the repository at this point in the history
  • Loading branch information
sopranopillow committed Sep 12, 2023
1 parent 7df5f7d commit 3bf2de9
Showing 1 changed file with 1 addition and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ const useStyles = makeStyles({

export const Icon = (props: Partial<TooltipProps>) => {
const styles = useStyles();
const iconId = useId('icon');
const contentId = useId('content');
const [visible, setVisible] = React.useState(false);

Expand All @@ -33,12 +32,7 @@ export const Icon = (props: Partial<TooltipProps>) => {
onVisibleChange={(e, data) => setVisible(data.visible)}
{...props}
>
<Info16Regular
tabIndex={0}
id={iconId}
aria-labelledby={`${iconId} ${contentId}`}
className={mergeClasses(visible && styles.visible)}
/>
<Info16Regular tabIndex={0} className={mergeClasses(visible && styles.visible)} />
</Tooltip>
</div>
);
Expand Down

0 comments on commit 3bf2de9

Please sign in to comment.