@@ -12,7 +12,9 @@ import {
1212 AfterContentInit ,
1313 HostBinding ,
1414 TemplateRef ,
15- OnDestroy
15+ OnDestroy ,
16+ ChangeDetectionStrategy ,
17+ ChangeDetectorRef
1618} from "@angular/core" ;
1719import { AbstractDropdownView , DropdownService } from "carbon-components-angular/dropdown" ;
1820import { ListItem } from "carbon-components-angular/dropdown" ;
@@ -138,7 +140,6 @@ import { Observable } from "rxjs";
138140 [placeholder]="placeholder"/>
139141 @if (invalid) {
140142 <svg
141-
142143 cdsIcon="warning--filled"
143144 size="16"
144145 class="cds--list-box__invalid-icon">
@@ -222,7 +223,8 @@ import { Observable } from "rxjs";
222223 useExisting : ComboBox ,
223224 multi : true
224225 }
225- ]
226+ ] ,
227+ changeDetection : ChangeDetectionStrategy . OnPush
226228} )
227229export class ComboBox implements OnChanges , AfterViewInit , AfterContentInit , OnDestroy {
228230 /**
@@ -500,7 +502,8 @@ export class ComboBox implements OnChanges, AfterViewInit, AfterContentInit, OnD
500502 constructor (
501503 protected elementRef : ElementRef ,
502504 protected dropdownService : DropdownService ,
503- protected i18n : I18n
505+ protected i18n : I18n ,
506+ protected cdr : ChangeDetectorRef
504507 ) { }
505508
506509 /**
@@ -743,6 +746,8 @@ export class ComboBox implements OnChanges, AfterViewInit, AfterContentInit, OnD
743746 }
744747
745748 document . removeEventListener ( "click" , this . outsideClick , true ) ;
749+
750+ this . cdr . markForCheck ( ) ;
746751 }
747752
748753 /**
@@ -766,6 +771,8 @@ export class ComboBox implements OnChanges, AfterViewInit, AfterContentInit, OnD
766771 this . _dropUp = this . _shouldDropUp ( ) ;
767772 }
768773 } , 0 ) ;
774+
775+ this . cdr . markForCheck ( ) ;
769776 }
770777
771778 /**
0 commit comments