diff --git a/CHANGELOG.md b/CHANGELOG.md index b3c6b4fe414..ec83d8f6048 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ - `EuiBasicTable` now converts the `EuiTableRowCell` `header` into `undefined` if it's been provided as a non-string node, hiding the header and preventing the node from being rendered as `[object Object]` on narrow screens ([#1312](https://github.com/elastic/eui/pull/1312)) - Fixed `fullWidth` size of `EuiComboBox`, a regression introduced in `4.7.0` ([#1314](https://github.com/elastic/eui/pull/1314)) +- Fixed error when passing empty string as `value` prop for `EuiSuperSelect` ([#1319](https://github.com/elastic/eui/pull/1319)) ## [`5.1.0`](https://github.com/elastic/eui/tree/v5.1.0) diff --git a/src-docs/src/views/super_select/super_select_complex.js b/src-docs/src/views/super_select/super_select_complex.js index 3a410f293f8..df0bb811d81 100644 --- a/src-docs/src/views/super_select/super_select_complex.js +++ b/src-docs/src/views/super_select/super_select_complex.js @@ -56,7 +56,7 @@ export default class extends Component { ]; this.state = { - value: this.options[1].value, + value: '', }; } diff --git a/src/components/form/super_select/__snapshots__/super_select_control.test.js.snap b/src/components/form/super_select/__snapshots__/super_select_control.test.js.snap index fb59b3c13c2..35651636266 100644 --- a/src/components/form/super_select/__snapshots__/super_select_control.test.js.snap +++ b/src/components/form/super_select/__snapshots__/super_select_control.test.js.snap @@ -179,6 +179,65 @@ Array [ ] `; +exports[`EuiSuperSelectControl props empty value option is rendered 1`] = ` +Array [ + , +
+
+ + Select an option: , is selected + +
+
, +] +`; + exports[`EuiSuperSelectControl props fullWidth is rendered 1`] = ` Array [ { expect(component) .toMatchSnapshot(); }); + + test('empty value option is rendered', () => { + const component = render( + {}} + /> + ); + + expect(component) + .toMatchSnapshot(); + }); }); });