Skip to content

Commit

Permalink
[sparkle] - fix: ensure buttons have an accessible aria-label (#8277)
Browse files Browse the repository at this point in the history
- A fallback is added for the aria-label attribute in the Button component to improve accessibility

Co-authored-by: Jules <jules@MacBook-Pro.local>
  • Loading branch information
JulesBelveze and Jules authored Oct 28, 2024
1 parent 25756d3 commit b9cb385
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sparkle/src/components/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
isSelect = false,
isPulsing = false,
size,
"aria-label": ariaLabel,
...props
},
ref
Expand Down Expand Up @@ -163,6 +164,7 @@ const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
variant={variant}
disabled={isLoading || props.disabled}
className={isPulsing ? "s-animate-pulse" : ""}
aria-label={ariaLabel || tooltip || label}
style={
{
"--pulse-color": "#93C5FD",
Expand Down

0 comments on commit b9cb385

Please sign in to comment.