mirror of
https://github.com/Dokploy/dokploy.git
synced 2026-06-16 04:35:24 +02:00
fix: ensure button type is correctly set when not explicitly defined
This commit is contained in:
@@ -55,6 +55,8 @@ const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
||||
ref,
|
||||
) => {
|
||||
const Comp = asChild ? Slot : "button";
|
||||
const type = props.type ?? undefined;
|
||||
|
||||
return (
|
||||
<>
|
||||
<Comp
|
||||
@@ -65,6 +67,7 @@ const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
||||
ref={ref}
|
||||
{...props}
|
||||
disabled={isLoading || props.disabled}
|
||||
type={type}
|
||||
>
|
||||
{isLoading && <Loader2 className="animate-spin" />}
|
||||
<Slottable>{children}</Slottable>
|
||||
|
||||
Reference in New Issue
Block a user