From d2f9e21f9e6b4ad9eb5fadc6999a5a7467b023ce Mon Sep 17 00:00:00 2001 From: Max Larionov Date: Fri, 27 Sep 2024 15:50:23 +0200 Subject: [PATCH] fix: unexpected overlay opening --- packages/ui/components/combobox/src/LionCombobox.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/ui/components/combobox/src/LionCombobox.js b/packages/ui/components/combobox/src/LionCombobox.js index 20e145493..c09f6ce0c 100644 --- a/packages/ui/components/combobox/src/LionCombobox.js +++ b/packages/ui/components/combobox/src/LionCombobox.js @@ -4,9 +4,9 @@ import { LionListbox } from '@lion/ui/listbox.js'; import { LocalizeMixin } from '@lion/ui/localize-no-side-effects.js'; import { OverlayMixin, withDropdownConfig } from '@lion/ui/overlays.js'; import { css, html } from 'lit'; +import { CustomChoiceGroupMixin } from '../../form-core/src/choice-group/CustomChoiceGroupMixin.js'; import { makeMatchingTextBold, unmakeMatchingTextBold } from './utils/makeMatchingTextBold.js'; import { MatchesOption } from './validators.js'; -import { CustomChoiceGroupMixin } from '../../form-core/src/choice-group/CustomChoiceGroupMixin.js'; const matchA11ySpanReverseFns = new WeakMap(); @@ -705,7 +705,11 @@ export class LionCombobox extends LocalizeMixin(OverlayMixin(CustomChoiceGroupMi // eslint-disable-next-line no-unused-vars _textboxOnInput(ev) { this.__shouldAutocompleteNextUpdate = true; - this.opened = true; + const lastKey = ev && ev.key; + this.opened = this._showOverlayCondition({ + lastKey, + currentValue: this._inputNode.value, + }); } /**