diff --git a/src/components/button/button.less b/src/components/button/button.less index 87fd3f710..d796d6f5a 100644 --- a/src/components/button/button.less +++ b/src/components/button/button.less @@ -8,7 +8,7 @@ background-color: transparent; padding: 0; - &:disabled { + &[aria-disabled='true'] { opacity: 0.4; cursor: not-allowed; } diff --git a/src/components/button/button.tsx b/src/components/button/button.tsx index 2b8eb8024..1a74b1973 100644 --- a/src/components/button/button.tsx +++ b/src/components/button/button.tsx @@ -64,8 +64,8 @@ const Button = React.forwardRef(function Button( ref={ref} type={type} className={className} - disabled={disabled || loading} - onClick={onClick} + aria-disabled={disabled || loading} + onClick={disabled || loading ? undefined : onClick} > {children} diff --git a/src/components/dropdown/__snapshots__/dropdown.test.tsx.snap b/src/components/dropdown/__snapshots__/dropdown.test.tsx.snap index 1b9005c8c..01fc95bd8 100644 --- a/src/components/dropdown/__snapshots__/dropdown.test.tsx.snap +++ b/src/components/dropdown/__snapshots__/dropdown.test.tsx.snap @@ -102,8 +102,8 @@ exports[`Dropdown Dropdown.Box renders the Body component first when top prop is size="default" >