Skip to content

Commit

Permalink
go back to reusing handlePopoverAction
Browse files Browse the repository at this point in the history
  • Loading branch information
awgraves committed Feb 29, 2024
1 parent 0dfbe9e commit c04f647
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions packages/gamut/src/ToolTip/FloatingToolTip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,6 @@ export const FloatingToolTip: React.FC<ToolTipPlacementComponentProps> = ({
}
};

const handlePopoverAction = ({
type,
}: React.MouseEvent<HTMLDivElement, MouseEvent>) => {
if (type === 'mouseenter' && !isOpen) {
setIsOpen(true);
}
if (type === 'mouseleave' && isOpen && !isFocused) {
setIsOpen(false);
}
};

return (
<Box
position="relative"
Expand All @@ -89,7 +78,7 @@ export const FloatingToolTip: React.FC<ToolTipPlacementComponentProps> = ({
>
{target}
</TargetContainer>
<TargetContainer onMouseEnter={(e) => handlePopoverAction(e)}>
<TargetContainer onMouseEnter={(e) => handleShowHideAction(e)}>
<Popover
{...popoverAlignments}
animation="fade"
Expand Down

0 comments on commit c04f647

Please sign in to comment.