Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix focus on single selection #1965

Merged
merged 8 commits into from
May 30, 2019
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