Skip to content

Commit ceba97f

Browse files
fix: update role to get applied conditionally and aria-describedBy (#1015)
Co-authored-by: Yuvraj Patadia <ypatadia@eightfold.ai>
1 parent d0fbb1f commit ceba97f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/components/Tooltip/Tooltip.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ export const Tooltip: FC<TooltipProps> = React.memo(
475475
'aria-controls': tooltipId?.current,
476476
'aria-expanded': mergedVisible,
477477
'aria-haspopup': true,
478-
role: 'button',
478+
...(trigger !== 'hover' && { role: 'button' }),
479479
'data-reference-id': tooltipReferenceId?.current,
480480
tabIndex: `${tabIndex}`,
481481
};
@@ -516,7 +516,7 @@ export const Tooltip: FC<TooltipProps> = React.memo(
516516
? toggle(true, showTooltip)
517517
: null
518518
}
519-
role="button"
519+
{...(trigger !== 'hover' && { role: 'button' })}
520520
tab-index={tabIndex}
521521
>
522522
{node}

0 commit comments

Comments
 (0)