fix tooltip asChild

This commit is contained in:
Qing 2023-01-07 21:08:02 +08:00
parent f1c7f6dc99
commit 9d6fc3bc42
3 changed files with 2 additions and 3 deletions

View File

@ -58,7 +58,7 @@ const Button: React.FC<ButtonProps> = props => {
].join(' ')} ].join(' ')}
> >
{icon} {icon}
{children ? <span>{children}</span> : null} {children}
</div> </div>
) )
} }

View File

@ -1,5 +1,4 @@
.tooltip-trigger { .tooltip-trigger {
all: unset;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;

View File

@ -13,7 +13,7 @@ const Tooltip = (props: MyTooltipProps) => {
return ( return (
<TooltipPrimitive.Root> <TooltipPrimitive.Root>
<TooltipPrimitive.Provider> <TooltipPrimitive.Provider>
<TooltipPrimitive.Trigger className="tooltip-trigger"> <TooltipPrimitive.Trigger className="tooltip-trigger" asChild>
{children} {children}
</TooltipPrimitive.Trigger> </TooltipPrimitive.Trigger>