@@ -34,15 +34,21 @@ import { ComboBoxMode, ComboBoxOption, ComboBoxResult } from './combo-box-api';
34
34
}
35
35
] ,
36
36
template : `
37
- <ht-popover (popoverOpen)="this.onPopoverOpen($event)" (popoverClose)="this.onPopoverClose()" class="combo-box">
37
+ <ht-popover
38
+ class="combo-box"
39
+ [disabled]="this.disabled"
40
+ (popoverOpen)="this.onPopoverOpen($event)"
41
+ (popoverClose)="this.onPopoverClose()"
42
+ >
38
43
<ht-popover-trigger>
39
44
<div
40
45
#trigger
41
46
class="popover-trigger"
42
47
[ngClass]="{
43
48
input: this.mode === '${ ComboBoxMode . Input } ',
44
49
chip: this.mode === '${ ComboBoxMode . Chip } ',
45
- 'show-border': this.showBorder
50
+ 'show-border': this.showBorder,
51
+ disabled: this.disabled
46
52
}"
47
53
[class.has-text]="this.text"
48
54
[class.input-focused]="input.matches(':focus')"
@@ -79,6 +85,7 @@ import { ComboBoxMode, ComboBoxOption, ComboBoxResult } from './combo-box-api';
79
85
80
86
<!-- Clear Button -->
81
87
<div
88
+ *ngIf="!this.disabled"
82
89
[class.has-text]="this.text"
83
90
[class.input-focused]="input.matches(':focus')"
84
91
[ngClass]="this.mode"
@@ -427,6 +434,10 @@ export class ComboBoxComponent<TValue = string> implements AfterViewInit, OnChan
427
434
} ) ;
428
435
}
429
436
437
+ public setDisabledState ( isDisabled ?: boolean ) : void {
438
+ this . disabled = isDisabled ?? false ;
439
+ }
440
+
430
441
private propagateValueChangeToFormControl ( value ?: string ) : void {
431
442
this . propagateControlValueChange ?.( value ) ;
432
443
this . propagateControlValueChangeOnTouch ?.( value ) ;
0 commit comments