From 1f057ab4c645c1164e5b214be8f033781098f022 Mon Sep 17 00:00:00 2001 From: Adam Detrick Date: Mon, 2 Dec 2024 17:51:54 -0500 Subject: [PATCH] fix(Tooltip): improve a11y on trigger element --- src/Tooltip/index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Tooltip/index.js b/src/Tooltip/index.js index c92525d4..e81923c7 100644 --- a/src/Tooltip/index.js +++ b/src/Tooltip/index.js @@ -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} @@ -81,7 +83,7 @@ const Tooltip = ({ )} - + , )} );