Skip to content

Commit

Permalink
feat: more params on tooltip wrapper. Avoid pointer events
Browse files Browse the repository at this point in the history
  • Loading branch information
MortenHofft committed Oct 23, 2024
1 parent 413662d commit 8c3ae9d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions packages/gbif-org/src/components/simpleTooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,19 @@ import { Tooltip, TooltipContent, TooltipTrigger } from './ui/tooltip';

export function SimpleTooltip({
title,
delayDuration = 0,
children,
side,
}: {
title: React.ReactNode;
delayDuration?: number;
children: React.ReactNode;
side: 'top' | 'right' | 'bottom' | 'left';
}) {
return (
<Tooltip delayDuration={0}>
<TooltipTrigger>{children}</TooltipTrigger>
<TooltipContent className='g-max-w-96' side={side}>{title}</TooltipContent>
<Tooltip delayDuration={delayDuration}>
<TooltipTrigger tabIndex={-1} asChild>{children}</TooltipTrigger>
<TooltipContent className='g-max-w-96 g-pointer-events-none' side={side}>{title}</TooltipContent>
</Tooltip>
);
}

0 comments on commit 8c3ae9d

Please sign in to comment.