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-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/__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.js b/src/components/form/radio/radio_group.js index e3bbecba490..6f578646424 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} /> @@ -39,6 +39,7 @@ EuiRadioGroup.propTypes = { id: PropTypes.string.isRequired, label: PropTypes.node, value: PropTypes.string, + disabled: PropTypes.bool, }), ).isRequired, idSelected: PropTypes.string, 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', () => { {}} />