Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/components/combo_box/combo_box.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,8 @@ export class EuiComboBox<T> extends Component<
this.comboBoxRefInstance &&
this.comboBoxRefInstance.contains(relatedTarget);

const singleSelection = Boolean(this.props.singleSelection);

if (!focusedInOptionsList && !focusedInInput) {
this.props.onBlur?.(event);
this.closeList();
Expand All @@ -467,7 +469,7 @@ export class EuiComboBox<T> extends Component<
if (!this.hasActiveOption()) {
this.setCustomOptions(true);
}
} else if (focusedInOptionsList) {
} else if (focusedInOptionsList && !singleSelection) {
// https://github.com/elastic/eui/issues/5179
// need to restore focus to the input box when clicking non-interactive elements

Expand Down Expand Up @@ -567,7 +569,7 @@ export class EuiComboBox<T> extends Component<
this.clearSearchValue();
this.clearActiveOption();

if (!isContainerBlur) {
if (!isContainerBlur && !singleSelection) {
this.searchInputRefInstance?.focus();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,7 @@ export class EuiComboBoxInput<T> extends Component<

const singleSelection = Boolean(singleSelectionProp);
const asPlainText =
(singleSelectionProp &&
typeof singleSelectionProp === 'object' &&
singleSelectionProp.asPlainText) ||
(singleSelectionProp as EuiComboBoxSingleSelectionShape).asPlainText ??
false;

const pills = selectedOptions
Expand Down