ui
ui copied to clipboard
[feat]: add `aria-disabled` to button component
Feature description
the button component should add the aria disabled, when the disabled metatag is active.
example:
const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
+ ({ className, variant, size, asChild = false, disabled = false, ...props }, ref) => {
const Comp = asChild ? Slot : "button"
return (
<Comp
className={cn(buttonVariants({ variant, size, className }))}
ref={ref}
+ disabled={disabled}
+ aria-disabled={disabled}
{...props}
/>
)
}
)```
### Affected component/components
Button
### Additional Context
Additional details here...
### Before submitting
- [X] I've made research efforts and searched the documentation
- [X] I've searched for existing issues and PRs
This prop can be controlled from the caller side. ie. <Button aria-disabled={true} />
Aria-disabled and disabled do not server the exact same use-cases so hardcoding them to be the same values is not a good choice in my opinion.
This issue has been automatically closed because it received no activity for a while. If you think it was closed by accident, please leave a comment. Thank you.