Skip to content

Commit

Permalink
Merge pull request #1437 from narmi/a11y/NDS-701-tooltip-button-label
Browse files Browse the repository at this point in the history
fix(Tooltip): improve a11y on trigger element
  • Loading branch information
akdetrick authored Dec 4, 2024
2 parents 6afb02e + 8045dd2 commit c201415
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Tooltip/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,11 @@ const Tooltip = ({
onBlur={closePopover}
onMouseEnter={openPopover}
onMouseLeave={closePopover}
role="button"
// Giving this element a "button" role is misleading in practice.
// eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
tabIndex="0"
data-testid="nds-tooltip-trigger"
aria-expanded={open}
>
{children}
</div>
Expand All @@ -81,7 +83,7 @@ const Tooltip = ({
<Arrow {...arrowProps} />
</div>
)}
</>
</>,
)}
</>
);
Expand Down

0 comments on commit c201415

Please sign in to comment.