From 2f2b27cf16afdb9a8b26ed4756ece58518c8c855 Mon Sep 17 00:00:00 2001 From: Yuvraj Patadia Date: Tue, 18 Mar 2025 15:30:38 -0700 Subject: [PATCH] fix: update role to get applied conditionally and aria-describedBy --- src/components/Accordion/Accordion.tsx | 2 +- src/components/Tooltip/Tooltip.tsx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/Accordion/Accordion.tsx b/src/components/Accordion/Accordion.tsx index c71adb607..68511e2af 100644 --- a/src/components/Accordion/Accordion.tsx +++ b/src/components/Accordion/Accordion.tsx @@ -98,7 +98,7 @@ export const AccordionSummary: FC = ({
= React.memo( 'aria-controls': tooltipId?.current, 'aria-expanded': mergedVisible, 'aria-haspopup': true, - role: 'button', + ...(trigger !== 'hover' && { role: 'button' }), 'data-reference-id': tooltipReferenceId?.current, tabIndex: `${tabIndex}`, }; @@ -514,7 +514,7 @@ export const Tooltip: FC = React.memo( ? toggle(true, showTooltip) : null } - role="button" + {...(trigger !== 'hover' && { role: 'button' })} tab-index={tabIndex} > {node}