From 2ae500d8219fcff425e0c1eb515d0b5bb1cc7a5e Mon Sep 17 00:00:00 2001 From: sulemanof Date: Mon, 27 May 2019 16:54:05 +0300 Subject: [PATCH 1/5] Fix focus on single selection --- src/components/combo_box/combo_box.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/combo_box/combo_box.js b/src/components/combo_box/combo_box.js index a135c5e0e42..40dca3d0ed3 100644 --- a/src/components/combo_box/combo_box.js +++ b/src/components/combo_box/combo_box.js @@ -433,7 +433,7 @@ export class EuiComboBox extends Component { if (singleSelection) { this.closeList(); - this.searchInput.blur(); + setTimeout(() => this.toggleButton.focus()); return; } From 74f530322baec706b8a80baa8701011e44b6a8c7 Mon Sep 17 00:00:00 2001 From: rockfield Date: Wed, 29 May 2019 14:50:04 +0300 Subject: [PATCH 2/5] Fix focus on single selection; now it just closes the list so that you can type another query and select smth else again. --- src/components/combo_box/combo_box.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/combo_box/combo_box.js b/src/components/combo_box/combo_box.js index 40dca3d0ed3..b174309ee07 100644 --- a/src/components/combo_box/combo_box.js +++ b/src/components/combo_box/combo_box.js @@ -433,7 +433,6 @@ export class EuiComboBox extends Component { if (singleSelection) { this.closeList(); - setTimeout(() => this.toggleButton.focus()); return; } From 3cd09740707065d272142260c850830ec10a509f Mon Sep 17 00:00:00 2001 From: rockfield Date: Wed, 29 May 2019 14:50:30 +0300 Subject: [PATCH 3/5] update CHANGELOG --- CHANGELOG.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e3f3a5f5c85..8f65421e374 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ ## [`master`](https://github.com/elastic/eui/tree/master) -No public interface changes since `11.2.0`. +**Bug fixes** + +- Fix focus on single selection ([#1965](https://github.com/elastic/eui/pull/1965)) ## [`11.2.0`](https://github.com/elastic/eui/tree/v11.2.0) From 4236f49e5547d58624b8158ce07e21299ae07530 Mon Sep 17 00:00:00 2001 From: maryia-lapata Date: Wed, 29 May 2019 18:18:17 +0300 Subject: [PATCH 4/5] Return focus to searchInput --- src/components/combo_box/combo_box.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/components/combo_box/combo_box.js b/src/components/combo_box/combo_box.js index b174309ee07..d94d2511038 100644 --- a/src/components/combo_box/combo_box.js +++ b/src/components/combo_box/combo_box.js @@ -430,16 +430,15 @@ export class EuiComboBox extends Component { ); this.clearSearchValue(); - - if (singleSelection) { - this.closeList(); - return; - } - this.clearActiveOption(); + if (!isContainerBlur) { this.searchInput.focus(); } + + if (singleSelection) { + this.closeList(); + } }; onRemoveOption = removedOption => { From d2b2f71a05aa2afd143073ddea6a9219c342f05d Mon Sep 17 00:00:00 2001 From: rockfield Date: Thu, 30 May 2019 11:18:05 +0300 Subject: [PATCH 5/5] Updated CHANGELOG.md --- CHANGELOG.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0fe1009a398..6878c6a8be2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,10 +10,7 @@ **Bug fixes** - Fixed environment setup for running `test-unit` script on Windows ([#1971](https://github.com/elastic/eui/pull/1971)) - -**Bug fixes** - -- Fix focus on single selection ([#1965](https://github.com/elastic/eui/pull/1965)) +- Fixed focus on single selection of EuiComboBox ([#1965](https://github.com/elastic/eui/pull/1965)) ## [`11.2.1`](https://github.com/elastic/eui/tree/v11.2.1)