diff --git a/.changeset/cool-peaches-burn.md b/.changeset/cool-peaches-burn.md index 6bc06d2aa..bed822eab 100644 --- a/.changeset/cool-peaches-burn.md +++ b/.changeset/cool-peaches-burn.md @@ -8,4 +8,5 @@ Allow Subclassers of LionCombobox to set '\_syncToTextboxCondition' in closing p ## Fixes -Allow an extra microtask in registration phase to make forms inside dialogs compatible. +- form-core: allow an extra microtask in registration phase to make forms inside dialogs compatible. +- combobox: open on focused when showAllOnEmpty diff --git a/packages/combobox/src/LionCombobox.js b/packages/combobox/src/LionCombobox.js index b377bbf76..3de26b7af 100644 --- a/packages/combobox/src/LionCombobox.js +++ b/packages/combobox/src/LionCombobox.js @@ -390,6 +390,9 @@ export class LionCombobox extends OverlayMixin(LionListbox) { */ // eslint-disable-next-line class-methods-use-this _showOverlayCondition({ lastKey }) { + if (this.showAllOnEmpty && this.focused) { + return true; + } // when no keyboard action involved (on focused change), return current opened state if (!lastKey) { return this.opened; diff --git a/packages/combobox/test/lion-combobox.test.js b/packages/combobox/test/lion-combobox.test.js index 4870f59b7..4c3131c41 100644 --- a/packages/combobox/test/lion-combobox.test.js +++ b/packages/combobox/test/lion-combobox.test.js @@ -177,6 +177,22 @@ describe('lion-combobox', () => { el.autocomplete = 'both'; await performChecks(); }); + + it('shows overlay on focusin', async () => { + const el = /** @type {LionCombobox} */ (await fixture(html` + + Artichoke + Chard + Chicory + Victoria Plum + + `)); + + expect(el.opened).to.be.false; + el._comboboxNode.dispatchEvent(new Event('focusin', { bubbles: true, composed: true })); + await el.updateComplete; + expect(el.opened).to.be.true; + }); }); });