From 790fc542bf259cc94da057e90145f00184bba93e Mon Sep 17 00:00:00 2001 From: cchaos Date: Thu, 22 Feb 2018 12:06:08 -0500 Subject: [PATCH 1/2] Fix error stemming from `selected` prop on `EuiSelect` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Apparently React doesn’t use this property and uses `value`/`defaultValue` similar to other inputs. --- src-docs/src/views/form/form_rows.js | 2 +- src/components/form/select/select.js | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src-docs/src/views/form/form_rows.js b/src-docs/src/views/form/form_rows.js index 5df637b10f0..073585fd113 100644 --- a/src-docs/src/views/form/form_rows.js +++ b/src-docs/src/views/form/form_rows.js @@ -129,7 +129,7 @@ export default class extends Component { label="Select (with no initial selection)" > { const classes = classNames( @@ -31,10 +32,10 @@ export const EuiSelect = ({ className ); - let emtpyOptionNode; + let emptyOptionNode; if (hasNoInitialSelection) { - emtpyOptionNode = ( - + emptyOptionNode = ( + ); } @@ -51,9 +52,10 @@ export const EuiSelect = ({ name={name} className={classes} ref={inputRef} + defaultValue={defaultValue || ''} {...rest} > - {emtpyOptionNode} + {emptyOptionNode} {options.map((option, index) => { const { text, From d9e81ec80894defe8fc6d9cfc03ef5cc367c445d Mon Sep 17 00:00:00 2001 From: cchaos Date: Fri, 23 Feb 2018 15:17:43 -0500 Subject: [PATCH 2/2] changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e2ce5f32c5d..4cbaa37b5b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ and logic ([#390](https://github.com/elastic/eui/pull/390)) **Bug fixes** - Fixed `EuiContextMenu` bug when using the keyboard to navigate up, which was caused by unnecessarily re-rendering the items, thus losing references to them ([#431](https://github.com/elastic/eui/pull/431)) +- Fix error stemming from `selected` prop on `EuiSelect` ([#436](https://github.com/elastic/eui/pull/436)) # [`0.0.22`](https://github.com/elastic/eui/tree/v0.0.22)