From 75bac5a6b84f7dd55c81d2901b56ec6f313b81da Mon Sep 17 00:00:00 2001 From: Trupti Wagh Date: Mon, 6 May 2024 13:17:29 -0700 Subject: [PATCH] fix(dropdown): force the the dropdown to expand when the input value changes #175 --- src/auro-combobox.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/auro-combobox.js b/src/auro-combobox.js index 9dfc6ec..68a91c7 100644 --- a/src/auro-combobox.js +++ b/src/auro-combobox.js @@ -402,7 +402,14 @@ export class AuroCombobox extends LitElement { this.hideBib(); this.classList.remove('combobox-filled'); } else if (!this.dropdown.isPopoverVisible && this.availableOptions) { - this.showBib(); + const hasFocus = this.contains(document.activeElement); + + // if the focus is within the combobox, then show the bib + // this will prevent the bib from being shown while loading & presetting the value + if (hasFocus) { + this.showBib(); + } + this.classList.add('combobox-filled'); }