From 8df8d37427615e4dbf3dc575f88b17b55e50b2c3 Mon Sep 17 00:00:00 2001 From: aidanCQ Date: Wed, 20 Mar 2024 16:48:51 +0000 Subject: [PATCH] fix(): Reduce tooltip delay. --- src/shadcn/ui/tooltip.tsx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/shadcn/ui/tooltip.tsx b/src/shadcn/ui/tooltip.tsx index 6efe784..576abcf 100644 --- a/src/shadcn/ui/tooltip.tsx +++ b/src/shadcn/ui/tooltip.tsx @@ -7,7 +7,17 @@ import { cn } from "src/utils" const TooltipProvider = TooltipPrimitive.Provider -const Tooltip = TooltipPrimitive.Root +const Tooltip = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ ...props }) => ( + +)) +TooltipPrimitive.Root.displayName = TooltipPrimitive.Root.displayName const TooltipTrigger = TooltipPrimitive.Trigger @@ -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} /> ))