Skip to content

Commit

Permalink
Allow passing isDisabled to individual button group button (#1424)
Browse files Browse the repository at this point in the history
  • Loading branch information
cchaos authored Jan 10, 2019
1 parent c07d560 commit 453d821
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
- Added `titleProps` and `descriptionProps` to `EuiDescriptionList` ([#1419](https://github.com/elastic/eui/pull/1419))
- Propagate `className` on `EuiCodeBlock` in fullscreen mode ([#1422](https://github.com/elastic/eui/pull/1422))
- Added `iconProps` prop to `EuiIconTip` ([#1420](https://github.com/elastic/eui/pull/1420))
- Added ability to pass `isDisabled` to individual `EuiButtonGroup` items ([#1424](https://github.com/elastic/eui/pull/1424))

**Bug fixes**

Expand Down
5 changes: 3 additions & 2 deletions src/components/button/button_group/button_group.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export const EuiButtonGroup = ({
iconSide={option.iconSide}
iconType={option.iconType}
id={option.id}
isDisabled={isDisabled}
isDisabled={isDisabled || option.isDisabled}
isIconOnly={isIconOnly}
isSelected={isSelectedState}
key={index}
Expand All @@ -70,7 +70,8 @@ EuiButtonGroup.propTypes = {
options: PropTypes.arrayOf(
PropTypes.shape({
id: PropTypes.string.isRequired,
label: PropTypes.string.isRequired
label: PropTypes.string.isRequired,
isDisabled: PropTypes.bool,
}),
).isRequired,
onChange: PropTypes.func.isRequired,
Expand Down

0 comments on commit 453d821

Please sign in to comment.