Skip to content

Commit

Permalink
SideNavigation: Remove Tooltip on dropdown open (#3134)
Browse files Browse the repository at this point in the history
  • Loading branch information
rlingineni authored Aug 18, 2023
1 parent 392235a commit b44cb2a
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { cloneElement, type Element, type Node, useEffect, useId, useRef, useSta
import Dropdown from '../Dropdown.js';
import Pog from '../Pog.js';
import TapArea from '../TapArea.js';
import Tooltip from '../Tooltip.js';
import MaybeTooltip from '../utils/MaybeTooltip.js';
import { CompositeZIndex, FixedZIndex, type Indexable } from '../zIndex.js';

type Props = {|
Expand Down Expand Up @@ -83,7 +83,10 @@ function ItemIconButton({
: new FixedZIndex(1);
const dropdownZIndex = new CompositeZIndex([tooltipZIndex]);
return (
<Tooltip accessibilityLabel="" text={tooltip.text} zIndex={tooltipZIndex}>
<MaybeTooltip
disabled={open}
tooltip={{ text: tooltip.text, accessibilityLabel: '', zIndex: tooltipZIndex }}
>
{/* Interactive elements require an a11yLabel on them or their children. That's why we set`accessibilityLabel` on `TapArea` instead of `Tooltip` */}
<TapArea
accessibilityControls={id}
Expand Down Expand Up @@ -155,7 +158,7 @@ function ItemIconButton({
</Dropdown>
)}
</TapArea>
</Tooltip>
</MaybeTooltip>
);
}

Expand Down

0 comments on commit b44cb2a

Please sign in to comment.