Skip to content

Commit afcaad7

Browse files
Fix disable color on iconbutton (#1638)
Co-authored-by: Brandon Scott <[email protected]>
1 parent 25ec16d commit afcaad7

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/buttons/src/IconButton.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import Button, { getIconSizeForButton, internalStyles, pseudoSelectors } from '.
77

88
const IconButton = memo(
99
forwardRef(function IconButton(props, ref) {
10-
const { icon, iconSize, ...restProps } = props
10+
const { disabled, icon, iconSize, ...restProps } = props
1111

1212
// modifiers
1313
const { appearance, intent = 'none', size = 'medium' } = props
@@ -27,11 +27,12 @@ const IconButton = memo(
2727
height={height}
2828
width={height}
2929
minWidth={height}
30+
disabled={disabled}
3031
{...restProps}
3132
>
3233
<IconWrapper
3334
icon={icon}
34-
color={intent === 'none' ? 'default' : 'currentColor'}
35+
color={intent === 'none' && !disabled ? 'default' : 'currentColor'}
3536
size={iconSize || relativeIconSize}
3637
/>
3738
</Button>

src/buttons/stories/index.stories.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,8 @@ buttonsStory.add('Button types', () => (
184184
<Button appearance="minimal" marginRight={16} intent="warning">
185185
Minimal
186186
</Button>
187+
<IconButton marginRight={16} icon={<Icons.PlusIcon />} />
188+
<IconButton marginRight={16} intent="danger" icon={<Icons.PlusIcon />} />
187189
</Box>
188190
<Heading marginTop={24}>Disabled Appearance</Heading>
189191
<Box marginTop={12}>
@@ -199,6 +201,8 @@ buttonsStory.add('Button types', () => (
199201
<Button disabled appearance="minimal" marginRight={16} intent="warning">
200202
Minimal
201203
</Button>
204+
<IconButton disabled icon={<Icons.PlusIcon />} marginRight={16} />
205+
<IconButton disabled marginRight={16} intent="danger" icon={<Icons.PlusIcon />} />
202206
</Box>
203207
</Box>
204208
))

0 commit comments

Comments
 (0)