From 4d7b6823b0e40835a1705ab8774c31486c3356dc Mon Sep 17 00:00:00 2001 From: Nathan Reese Date: Fri, 10 Aug 2018 15:04:53 -0600 Subject: [PATCH 1/3] disable radio group option --- src-docs/src/views/form_controls/radio_group.js | 1 + src/components/form/radio/radio_group.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src-docs/src/views/form_controls/radio_group.js b/src-docs/src/views/form_controls/radio_group.js index b96f0e57516..0732d4b61fb 100644 --- a/src-docs/src/views/form_controls/radio_group.js +++ b/src-docs/src/views/form_controls/radio_group.js @@ -26,6 +26,7 @@ export default class extends Component { }, { id: `${idPrefix}2`, label: 'Option three', + disabled: true, }]; this.state = { diff --git a/src/components/form/radio/radio_group.js b/src/components/form/radio/radio_group.js index e3bbecba490..45018ff4883 100644 --- a/src/components/form/radio/radio_group.js +++ b/src/components/form/radio/radio_group.js @@ -24,7 +24,7 @@ export const EuiRadioGroup = ({ checked={option.id === idSelected} label={option.label} value={option.value} - disabled={disabled} + disabled={disabled || option.disabled} onChange={onChange.bind(null, option.id, option.value)} compressed={compressed} /> From 21d5e189a471b53602f18effb07b830ccf0f15d7 Mon Sep 17 00:00:00 2001 From: Nathan Reese Date: Fri, 10 Aug 2018 15:12:59 -0600 Subject: [PATCH 2/3] update changelog and jest test --- CHANGELOG.md | 2 +- .../form/radio/__snapshots__/radio_group.test.js.snap | 1 + src/components/form/radio/radio_group.test.js | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b69bcf7ba44..493928d24e9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ ## [`master`](https://github.com/elastic/eui/tree/master) -No public interface changes since `3.5.1`. +- Added `disabled` to `EuiRadioGroup.options` ([#1111](https://github.com/elastic/eui/pull/1111)) ## [`3.5.1`](https://github.com/elastic/eui/tree/v3.5.1) diff --git a/src/components/form/radio/__snapshots__/radio_group.test.js.snap b/src/components/form/radio/__snapshots__/radio_group.test.js.snap index eafc29ab7fe..1cfb7a45ec3 100644 --- a/src/components/form/radio/__snapshots__/radio_group.test.js.snap +++ b/src/components/form/radio/__snapshots__/radio_group.test.js.snap @@ -118,6 +118,7 @@ exports[`EuiRadioGroup props options are rendered 1`] = ` > diff --git a/src/components/form/radio/radio_group.test.js b/src/components/form/radio/radio_group.test.js index 8c7e67dc755..7a6ab7aede2 100644 --- a/src/components/form/radio/radio_group.test.js +++ b/src/components/form/radio/radio_group.test.js @@ -22,7 +22,7 @@ describe('EuiRadioGroup', () => { {}} /> From e5d03c2ea22f64f6c5d7f40729d1ba76d435979c Mon Sep 17 00:00:00 2001 From: Nathan Reese Date: Mon, 13 Aug 2018 10:46:40 -0600 Subject: [PATCH 3/3] add disabled to options proptype --- src/components/form/radio/radio_group.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/form/radio/radio_group.js b/src/components/form/radio/radio_group.js index 45018ff4883..6f578646424 100644 --- a/src/components/form/radio/radio_group.js +++ b/src/components/form/radio/radio_group.js @@ -39,6 +39,7 @@ EuiRadioGroup.propTypes = { id: PropTypes.string.isRequired, label: PropTypes.node, value: PropTypes.string, + disabled: PropTypes.bool, }), ).isRequired, idSelected: PropTypes.string,