File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed
Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -89,6 +89,7 @@ export class PfSearchInput extends LitElement {
8989
9090 /** True when the user just clicked the close button */
9191 #clickedCloseButton = false ;
92+ #setExpanded = false ;
9293
9394 #combobox = ComboboxController . of ( this , {
9495 getItems : ( ) => this . options ,
@@ -299,7 +300,16 @@ export class PfSearchInput extends LitElement {
299300
300301 async #showListbox( ) {
301302 await new Promise ( requestAnimationFrame ) ;
302- if ( ! this . disabled ) {
303+ if ( this . disabled ) {
304+ return ;
305+ } ;
306+
307+ if ( this . #setExpanded) {
308+ // If expanded is set to true on clicking close button
309+ // set expanded to false
310+ this . #setExpanded = false ;
311+ this . expanded = false ;
312+ } else {
303313 this . expanded ||= true ;
304314 }
305315 }
@@ -322,10 +332,7 @@ export class PfSearchInput extends LitElement {
322332 #setIsExpanded( ) {
323333 if ( this . #clickedCloseButton) {
324334 this . #clickedCloseButton = false ;
325- setTimeout ( ( ) => {
326- this . hide ( ) ;
327- // prevent the listbox from showing when we only intend to clear the input
328- } , 10 ) ;
335+ this . #setExpanded = true ;
329336 return true ;
330337 }
331338 return this . expanded ;
You can’t perform that action at this time.
0 commit comments