From 453d82121b2230882079686fc5596cd29f787394 Mon Sep 17 00:00:00 2001 From: Caroline Horn <549577+cchaos@users.noreply.github.com> Date: Thu, 10 Jan 2019 12:19:14 -0500 Subject: [PATCH] Allow passing `isDisabled` to individual button group button (#1424) --- CHANGELOG.md | 1 + src/components/button/button_group/button_group.js | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3781022d2e8..0772eb061b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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** diff --git a/src/components/button/button_group/button_group.js b/src/components/button/button_group/button_group.js index b7080ba6d88..da8f0632c20 100644 --- a/src/components/button/button_group/button_group.js +++ b/src/components/button/button_group/button_group.js @@ -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} @@ -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,