Skip to content

Commit 874deab

Browse files
committed
fix(Button): prevent redundant button role
1 parent 2e70e2a commit 874deab

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/react-ui/src/components/button/button.tsx

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { isNumber } from "@resolid/utils";
2-
import type { CSSProperties, ReactNode } from "react";
2+
import type { AriaRole, CSSProperties, ReactNode } from "react";
33
import { useButtonProps } from "../../hooks";
44
import { Polymorphic, type PolymorphicProps } from "../../primitives";
55
import { dataAttr, tx } from "../../utils";
@@ -79,14 +79,16 @@ export const Button = (props: PolymorphicProps<"button", ButtonProps, "role">) =
7979
className,
8080
style,
8181
children,
82+
role,
8283
...rest
83-
} = props;
84+
} = props as typeof props & { role?: AriaRole };
8485

8586
const disabledStatus = disabled || loading;
8687

8788
const buttonProps = useButtonProps({
8889
hasRender: !!render,
8990
type,
91+
role,
9092
tabIndex,
9193
disabled: disabledStatus,
9294
});

0 commit comments

Comments
 (0)