@@ -288,10 +288,7 @@ export class ChComboBoxRender
288288 @Watch ( "expanded" )
289289 handleExpandedChange ( newExpandedValue : boolean ) {
290290 if ( newExpandedValue && ! mobileDevice ) {
291- this . #itemImages = getComboBoxImages (
292- this . model ,
293- this . #getActualImagePathCallback( )
294- ) ;
291+ this . #setComboBoxIcons( ) ;
295292
296293 // Sync the active descendant when expanding the combo-box
297294 this . #syncActiveDescendant( ) ;
@@ -350,6 +347,14 @@ export class ChComboBoxRender
350347 this . #valueToItemInfo,
351348 this . #captionToItemInfo
352349 ) ;
350+
351+ // TODO: Add a unit test for this
352+ // The model can change when the combo-box is expanded by having server
353+ // filters. In this case, we need to re-compute the icons
354+ if ( this . expanded ) {
355+ this . #setComboBoxIcons( ) ;
356+ }
357+
353358 // this.#checkIfCurrentSelectedValueIsNoLongerValid();
354359
355360 // This must be the last operation, since it needs to wait for the UI Model
@@ -464,6 +469,13 @@ export class ChComboBoxRender
464469 getControlRegisterProperty ( "getImagePathCallback" , "ch-combo-box-render" ) ??
465470 DEFAULT_GET_IMAGE_PATH_CALLBACK ;
466471
472+ #setComboBoxIcons = ( ) => {
473+ this . #itemImages = getComboBoxImages (
474+ this . model ,
475+ this . #getActualImagePathCallback( )
476+ ) ;
477+ } ;
478+
467479 #scheduleFilterProcessing = ( ) => {
468480 this . #applyFilters = true ;
469481 } ;
0 commit comments