fix: search autofocus
This commit is contained in:
1 parent
a64866fdf5
commit
b2eef6c494
3 files changed
+29
-19
No files matched your search
@@ -37,19 +37,28 @@ export interface ButtonProps
|
||||
asChild?: boolean;
|
||||
}
|
||||
|
||||
const Button = React.forwardRef<HTMLButtonElement, HTMLMotionProps<'button'> & Pick<ButtonProps, 'size' | 'variant'>>(
|
||||
({ className, variant, size, ...props }, ref) => {
|
||||
const Button = React.forwardRef<
|
||||
HTMLButtonElement,
|
||||
HTMLMotionProps<'button'> & Pick<ButtonProps, 'size' | 'variant'> & { base?: boolean }
|
||||
>(({ className, variant, size, base, ...props }, ref) => {
|
||||
if (base)
|
||||
return (
|
||||
<motion.button
|
||||
<button
|
||||
className={cn(buttonVariants({ variant, size, className }))}
|
||||
ref={ref}
|
||||
{...props}
|
||||
onClick={undefined}
|
||||
onTap={(e) => props.onClick?.(e as unknown as React.MouseEvent<HTMLButtonElement, MouseEvent>)}
|
||||
{...(props as unknown as ButtonProps)}
|
||||
/>
|
||||
);
|
||||
}
|
||||
);
|
||||
return (
|
||||
<motion.button
|
||||
className={cn(buttonVariants({ variant, size, className }))}
|
||||
ref={ref}
|
||||
{...props}
|
||||
onClick={undefined}
|
||||
onTap={(e) => props.onClick?.(e as unknown as React.MouseEvent<HTMLButtonElement, MouseEvent>)}
|
||||
/>
|
||||
);
|
||||
});
|
||||
Button.displayName = 'Button';
|
||||
|
||||
export { Button, buttonVariants };
|
||||
Reference in new issue
Block a user