From b34cba8e8823574692f8fb6bac94f6cb43b19534 Mon Sep 17 00:00:00 2001 From: Sarka Chwastkova Date: Tue, 26 Nov 2024 17:53:04 +0100 Subject: [PATCH] fix(TooltipPrimitive): remove redundant role attribute --- .../components/TooltipContent.tsx | 83 ++++++++++--------- 1 file changed, 42 insertions(+), 41 deletions(-) diff --git a/packages/orbit-components/src/primitives/TooltipPrimitive/components/TooltipContent.tsx b/packages/orbit-components/src/primitives/TooltipPrimitive/components/TooltipContent.tsx index 93b0855950..76d0e84b2d 100644 --- a/packages/orbit-components/src/primitives/TooltipPrimitive/components/TooltipContent.tsx +++ b/packages/orbit-components/src/primitives/TooltipPrimitive/components/TooltipContent.tsx @@ -105,54 +105,55 @@ const TooltipContent = ({ [onClose, onCloseMobile, elements.floating], ); + const handleCombinedClick = (ev: React.MouseEvent) => { + handleInnerClick(ev); + onClick(ev); + }; + return ( - // Disabling because the onClick exists just to stop propagation of events + // Disabling because the onClick exists to close tooltip when clicking in interactive elements, which should not happen with keyboard. // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions -