Skip to content

Commit

Permalink
feat: assign role="button" when element type of a <Button> is not a b…
Browse files Browse the repository at this point in the history
…utton
  • Loading branch information
receter committed Sep 18, 2024
1 parent 97dc6fe commit 749265a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/ui/lib/Button/useBaseButton.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { HTMLAttributes, ReactNode, useRef } from "react";
import React, { HTMLAttributes, useRef } from "react";
import { mergeRefs } from "react-merge-refs";

import { Sys42Props } from "../types";
Expand Down Expand Up @@ -26,6 +26,7 @@ export function useBaseButton<
return {
buttonProps: {
type: elementType === "button" ? "button" : undefined,
role: elementType !== "button" ? "button" : undefined,
...props,
},
buttonRef: mergeRefs([forwardedRef, ref]),
Expand Down

0 comments on commit 749265a

Please sign in to comment.