Skip to content

Commit

Permalink
Fix focus on single selection (#1965)
Browse files Browse the repository at this point in the history
* Fix focus on single selection

* Fix focus on single selection; now it just closes the list so that you can type another query and select smth else again.

* update CHANGELOG

* Return focus to searchInput

* Updated CHANGELOG.md
  • Loading branch information
sulemanof authored and thompsongl committed May 30, 2019
1 parent 59cb02a commit ab169aa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
**Bug fixes**

- Fixed environment setup for running `test-unit` script on Windows ([#1971](https://github.com/elastic/eui/pull/1971))
- 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)

Expand Down
12 changes: 5 additions & 7 deletions src/components/combo_box/combo_box.js
Original file line number Diff line number Diff line change
Expand Up @@ -430,17 +430,15 @@ export class EuiComboBox extends Component {
);

this.clearSearchValue();

if (singleSelection) {
this.closeList();
this.searchInput.blur();
return;
}

this.clearActiveOption();

if (!isContainerBlur) {
this.searchInput.focus();
}

if (singleSelection) {
this.closeList();
}
};

onRemoveOption = removedOption => {
Expand Down

0 comments on commit ab169aa

Please sign in to comment.