diff --git a/packages/calcite-components/src/components/combobox/combobox.tsx b/packages/calcite-components/src/components/combobox/combobox.tsx index be4f5a0cb5d..7ed26bc55bd 100644 --- a/packages/calcite-components/src/components/combobox/combobox.tsx +++ b/packages/calcite-components/src/components/combobox/combobox.tsx @@ -761,19 +761,19 @@ export class Combobox this.updateActiveItemIndex(targetIndex); } - setInactiveIfNotContained = (event: Event): void => { + private setInactiveIfNotContained = (event: Event): void => { const composedPath = event.composedPath(); + if (!this.open || composedPath.includes(this.el) || composedPath.includes(this.referenceEl)) { + return; + } + if (!this.allowCustomValues && this.textInput.value) { this.clearInputValue(); this.filterItems(""); this.updateActiveItemIndex(-1); } - if (!this.open || composedPath.includes(this.el) || composedPath.includes(this.referenceEl)) { - return; - } - if (this.allowCustomValues && this.text.trim().length) { this.addCustomChip(this.text); }