@@ -535,6 +535,36 @@ describe('Combobox', () => {
535535 expect ( inputElement . getAttribute ( 'aria-expanded' ) ) . toBe ( 'true' ) ;
536536 } ) ;
537537 } ) ;
538+
539+ describe ( 'Disabled' , ( ) => {
540+ beforeEach ( ( ) => setupCombobox ( ) ) ;
541+
542+ it ( 'should keep the input focusable by default when disabled' , ( ) => {
543+ fixture . componentInstance . disabled . set ( true ) ;
544+ fixture . detectChanges ( ) ;
545+
546+ expect ( inputElement . disabled ) . toBe ( false ) ;
547+ expect ( inputElement . getAttribute ( 'aria-disabled' ) ) . toBe ( 'true' ) ;
548+ } ) ;
549+
550+ it ( 'should block interactions when disabled' , ( ) => {
551+ fixture . componentInstance . disabled . set ( true ) ;
552+ fixture . detectChanges ( ) ;
553+
554+ focus ( ) ;
555+ keydown ( 'ArrowDown' ) ;
556+ expect ( inputElement . getAttribute ( 'aria-expanded' ) ) . toBe ( 'false' ) ;
557+ } ) ;
558+
559+ it ( 'should make the input unfocusable when softDisabled is false' , ( ) => {
560+ fixture . componentInstance . disabled . set ( true ) ;
561+ fixture . componentInstance . softDisabled . set ( false ) ;
562+ fixture . detectChanges ( ) ;
563+
564+ expect ( inputElement . disabled ) . toBe ( true ) ;
565+ expect ( inputElement . getAttribute ( 'aria-disabled' ) ) . toBe ( 'true' ) ;
566+ } ) ;
567+ } ) ;
538568 } ) ;
539569
540570 describe ( 'with Tree' , ( ) => {
@@ -1145,6 +1175,8 @@ describe('Combobox', () => {
11451175 [(value)]="searchString"
11461176 [(expanded)]="popupExpanded"
11471177 [readonly]="readonly()"
1178+ [disabled]="disabled()"
1179+ [softDisabled]="softDisabled()"
11481180 [alwaysExpanded]="alwaysExpanded()"
11491181 (focusout)="onBlur()"
11501182 />
@@ -1168,6 +1200,8 @@ describe('Combobox', () => {
11681200} )
11691201class ComboboxListboxExample {
11701202 readonly = signal ( false ) ;
1203+ disabled = signal ( false ) ;
1204+ softDisabled = signal ( true ) ;
11711205 alwaysExpanded = signal ( false ) ;
11721206 popupExpanded = signal ( false ) ;
11731207 searchString = signal ( '' ) ;
0 commit comments