From b07b1214d5d66665a52c2891ef212ed5a9152db6 Mon Sep 17 00:00:00 2001 From: CJ Cenizal Date: Thu, 6 Dec 2018 15:48:28 -0800 Subject: [PATCH 1/4] `EuiComboBox` will convert entered text into a custom option when the user takes away focus, e.g. by tabbing to another element. This prevents the `EuiComboBox` from being mistaken for a `EuiInputText`. --- CHANGELOG.md | 1 + src/components/combo_box/combo_box.js | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4760f0d0805..04555252534 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ - Altered functionality of `truncate` on `EuiBreadcrumbs` and added `truncate` ability on breadcrumb item ([#1346](https://github.com/elastic/eui/pull/1346)) - Altered `EuiHeader`'s location of `EuiHeaderBreadcrumbs` based on the new `truncate` ability ([#1346](https://github.com/elastic/eui/pull/1346)) - Added support for `href` and `target` props in `EuiBasicTable` actions ([#1347](https://github.com/elastic/eui/pull/1347)) +- `EuiComboBox` will convert entered text into a custom option when the user takes away focus, e.g. by tabbing to another element. This prevents the `EuiComboBox` from being mistaken for a `EuiInputText`. ## [`5.4.0`](https://github.com/elastic/eui/tree/v5.4.0) diff --git a/src/components/combo_box/combo_box.js b/src/components/combo_box/combo_box.js index c81d2f3170b..38442993128 100644 --- a/src/components/combo_box/combo_box.js +++ b/src/components/combo_box/combo_box.js @@ -258,6 +258,12 @@ export class EuiComboBox extends Component { this.closeList(); } + // If the user tabs away or changes focus to another element, take whatever input they've + // typed and convert it into a pill, to prevent the combo box from looking like a text input. + if (!this.hasActiveOption()) { + this.addCustomOption(); + } + if (this.props.onBlur) { this.props.onBlur(e); } From 66772c487143afcb2eae4a46bab207593ea49bf6 Mon Sep 17 00:00:00 2001 From: CJ Cenizal Date: Thu, 6 Dec 2018 15:54:17 -0800 Subject: [PATCH 2/4] Changelog. --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 04555252534..feb703d3425 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ - Altered functionality of `truncate` on `EuiBreadcrumbs` and added `truncate` ability on breadcrumb item ([#1346](https://github.com/elastic/eui/pull/1346)) - Altered `EuiHeader`'s location of `EuiHeaderBreadcrumbs` based on the new `truncate` ability ([#1346](https://github.com/elastic/eui/pull/1346)) - Added support for `href` and `target` props in `EuiBasicTable` actions ([#1347](https://github.com/elastic/eui/pull/1347)) -- `EuiComboBox` will convert entered text into a custom option when the user takes away focus, e.g. by tabbing to another element. This prevents the `EuiComboBox` from being mistaken for a `EuiInputText`. +- `EuiComboBox` will convert entered text into a custom option when the user takes away focus, e.g. by tabbing to another element. This prevents the `EuiComboBox` from being mistaken for a `EuiInputText`. ([#1353](https://github.com/elastic/eui/pull/1353)) ## [`5.4.0`](https://github.com/elastic/eui/tree/v5.4.0) From 7fb49557d9b01ac6be70dca2de7b59d9614e80fd Mon Sep 17 00:00:00 2001 From: CJ Cenizal Date: Fri, 7 Dec 2018 11:44:31 -0800 Subject: [PATCH 3/4] Changelog. --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index feb703d3425..d17d473b13c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ - Altered functionality of `truncate` on `EuiBreadcrumbs` and added `truncate` ability on breadcrumb item ([#1346](https://github.com/elastic/eui/pull/1346)) - Altered `EuiHeader`'s location of `EuiHeaderBreadcrumbs` based on the new `truncate` ability ([#1346](https://github.com/elastic/eui/pull/1346)) - Added support for `href` and `target` props in `EuiBasicTable` actions ([#1347](https://github.com/elastic/eui/pull/1347)) -- `EuiComboBox` will convert entered text into a custom option when the user takes away focus, e.g. by tabbing to another element. This prevents the `EuiComboBox` from being mistaken for a `EuiInputText`. ([#1353](https://github.com/elastic/eui/pull/1353)) +- Added support for `EuiComboBox` converting entered text into a custom option when the user removes focus, e.g. by tabbing to another element. This prevents the `EuiComboBox` from being mistaken for an `EuiInputText`. ([#1353](https://github.com/elastic/eui/pull/1353)) ## [`5.4.0`](https://github.com/elastic/eui/tree/v5.4.0) From aedd0570bce6f3cabdf3b326d0f6dbcd49d27e6c Mon Sep 17 00:00:00 2001 From: CJ Cenizal Date: Fri, 7 Dec 2018 12:40:58 -0800 Subject: [PATCH 4/4] Bad, merge resolution! Bad. --- CHANGELOG.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 86330eeb6be..24432ed3619 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,11 +9,7 @@ **Bug fixes** - Fixed word-breaks in table cells for Firefox ([#1349](https://github.com/elastic/eui/pull/1349)) - -**Bug fixes** - - Fixed EUI when used in an environment lacking ES Modules support, e.g. Jest ([#1358](https://github.com/elastic/eui/pull/1358)) ->>>>>>> upstream/master ## [`5.4.0`](https://github.com/elastic/eui/tree/v5.4.0)