Skip to content

Commit 43f8895

Browse files
committed
fix(Button): no longer shows hover or active style when disabled
1 parent b696f58 commit 43f8895

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/components/Button/_Button.scss

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
color: $color-contrast-1;
3636
fill: $color-contrast-1;
3737

38-
&:active {
38+
&:active:not(.ui__button--disabled) {
3939
border-color: $color-blue-gray-6;
4040
background-color: $color-blue-gray-6;
4141
}
@@ -47,7 +47,7 @@
4747
color: $color-blue-gray-5;
4848
fill: $color-blue-gray-5;
4949

50-
&:active {
50+
&:active:not(.ui__button--disabled) {
5151
color: $color-blue-gray-6;
5252
fill: $color-blue-gray-6;
5353
}
@@ -61,13 +61,13 @@
6161
transition: background-color 75ms ease-in-out, color 75ms ease-in-out;
6262

6363
&:focus.ui__button--tabbing,
64-
&:hover {
64+
&:hover:not(.ui__button--disabled) {
6565
background-color: $color-blue-gray-5;
6666
color: $color-contrast-1;
6767
fill: $color-contrast-1;
6868
}
6969

70-
&:active {
70+
&:active:not(.ui__button--disabled) {
7171
border-color: $color-blue-gray-6;
7272
background-color: $color-blue-gray-6;
7373
}

src/components/ClickableDiv/ClickableDiv.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export const ClickableDiv = forwardRef<HTMLDivElement, ClickableDivProps>(
2626

2727
const handleOnClick = useOnClick(onClick, { disabled, stopPropagation: true });
2828

29-
const handleKeyUp = useKeyForClick(onKeyPress, clickableDivRef);
29+
const handleKeyPress = useKeyForClick(onKeyPress, clickableDivRef);
3030

3131
const isUserTabbing = useAccessibleFocus();
3232

@@ -48,7 +48,7 @@ export const ClickableDiv = forwardRef<HTMLDivElement, ClickableDivProps>(
4848
tabIndex={disabled ? -1 : tabIndex ?? 0}
4949
className={clickableDivClass}
5050
onClick={handleOnClick}
51-
onKeyPress={handleKeyUp}
51+
onKeyPress={handleKeyPress}
5252
ref={clickableDivRef}
5353
>
5454
{children}

0 commit comments

Comments
 (0)