@@ -134,7 +134,11 @@ export class Combobox
134
134
item && filteredData . some ( ( { el } ) => item === el ) ;
135
135
136
136
return debounce ( ( text : string , setOpenToEmptyState = false , emit = true ) : void => {
137
- const filteredData = filter ( [ ...this . data , ...this . groupData ] , text , this . effectiveFilterProps ) ;
137
+ const filteredData = filter (
138
+ [ ...this . data , ...this . groupData ] ,
139
+ text ,
140
+ this . effectiveFilterProps ,
141
+ ) ;
138
142
const itemsAndGroups = this . getItemsAndGroups ( ) ;
139
143
140
144
const matchAll = text === "" ;
@@ -551,7 +555,6 @@ export class Combobox
551
555
this . internalValueChangeFlag = false ;
552
556
this . mutationObserver ?. observe ( this . el , { childList : true , subtree : true } ) ;
553
557
554
- this . updateItems ( ) ;
555
558
this . setFilteredPlacements ( ) ;
556
559
557
560
if ( this . open ) {
@@ -564,7 +567,6 @@ export class Combobox
564
567
565
568
async load ( ) : Promise < void > {
566
569
setUpLoadableComponent ( this ) ;
567
- this . updateItems ( ) ;
568
570
this . filterItems ( this . filterText , false , false ) ;
569
571
}
570
572
@@ -592,10 +594,7 @@ export class Combobox
592
594
this . reposition ( true ) ;
593
595
}
594
596
595
- if (
596
- ( changes . has ( "selectionMode" ) && ( this . hasUpdated || this . selectionMode !== "multiple" ) ) ||
597
- ( changes . has ( "scale" ) && ( this . hasUpdated || this . scale !== "m" ) )
598
- ) {
597
+ if ( changes . has ( "selectionMode" ) || changes . has ( "scale" ) ) {
599
598
this . updateItems ( ) ;
600
599
}
601
600
@@ -1233,7 +1232,7 @@ export class Combobox
1233
1232
return this . filterText === "" ? this . items : this . items . filter ( ( item ) => ! item . hidden ) ;
1234
1233
}
1235
1234
1236
- private updateItems ( ) : void {
1235
+ private updateItems = debounce ( ( ) : void => {
1237
1236
this . items = this . getItems ( ) ;
1238
1237
this . groupItems = this . getGroupItems ( ) ;
1239
1238
this . data = this . getData ( ) ;
@@ -1264,7 +1263,7 @@ export class Combobox
1264
1263
nextGroupItem . afterEmptyGroup = groupItem . children . length === 0 ;
1265
1264
}
1266
1265
} ) ;
1267
- }
1266
+ } , DEBOUNCE . nextTick ) ;
1268
1267
1269
1268
private getData ( ) : ItemData [ ] {
1270
1269
return this . items . map ( ( item ) => ( {
0 commit comments