Skip to content

Commit

Permalink
fix(): Reduce tooltip delay.
Browse files Browse the repository at this point in the history
  • Loading branch information
aidanCQ committed Mar 20, 2024
1 parent 40253b5 commit 8df8d37
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/shadcn/ui/tooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,17 @@ import { cn } from "src/utils"

const TooltipProvider = TooltipPrimitive.Provider

const Tooltip = TooltipPrimitive.Root
const Tooltip = React.forwardRef<
React.ElementRef<typeof TooltipPrimitive.Root>,
React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Root>
>(({ ...props }) => (
<TooltipPrimitive.Root

delayDuration={0}
{...props}
/>
))
TooltipPrimitive.Root.displayName = TooltipPrimitive.Root.displayName

const TooltipTrigger = TooltipPrimitive.Trigger

Expand All @@ -22,6 +32,7 @@ const TooltipContent = React.forwardRef<
"z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
className
)}

{...props}
/>
))
Expand Down

0 comments on commit 8df8d37

Please sign in to comment.