From e273f6c9e79695543fb723dc3a85f9edbb72ac25 Mon Sep 17 00:00:00 2001 From: Joy Serquina Date: Tue, 21 Oct 2025 23:17:51 +0000 Subject: [PATCH 1/3] feat(aria/combobox): adds disabled binding to aria combobox.ts Adds disabled binding to aria combobox.ts to have disabled attribute be automatically added as aria-disabled on the parent div and disabled on the input of combobox. --- src/aria/combobox/combobox.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/aria/combobox/combobox.ts b/src/aria/combobox/combobox.ts index 8490508f7476..d437ae85514a 100644 --- a/src/aria/combobox/combobox.ts +++ b/src/aria/combobox/combobox.ts @@ -37,6 +37,7 @@ import {toSignal} from '@angular/core/rxjs-interop'; }, ], host: { + '[attr.aria-disabled]': 'disabled()', '[attr.data-expanded]': 'pattern.expanded()', '(input)': 'pattern.onInput($event)', '(keydown)': 'pattern.onKeydown($event)', @@ -119,6 +120,7 @@ export class Combobox { '[attr.aria-controls]': 'combobox.pattern.popupId()', '[attr.aria-haspopup]': 'combobox.pattern.hasPopup()', '[attr.aria-autocomplete]': 'combobox.pattern.autocomplete()', + '[disabled]': 'combobox.disabled()', }, }) export class ComboboxInput { From 7d2d12113a437de3e6a6270459b3406ea6571834 Mon Sep 17 00:00:00 2001 From: Joy Serquina Date: Wed, 22 Oct 2025 16:01:53 +0000 Subject: [PATCH 2/3] feat(aria/combobox): adds disabled combobox to dev-app Updates dev-app to add disabled combobox using the proposed disabled bindings to aria/combobox.ts. --- .../combobox-disabled-example.html | 17 +++++++++++++++ .../combobox-disabled.example.ts | 21 +++++++++++++++++++ .../aria/combobox/combobox-examples.css | 11 ++++++++++ .../aria/combobox/index.ts | 1 + src/dev-app/aria-combobox/combobox-demo.html | 5 +++++ src/dev-app/aria-combobox/combobox-demo.ts | 2 ++ 6 files changed, 57 insertions(+) create mode 100644 src/components-examples/aria/combobox/combobox-disabled/combobox-disabled-example.html create mode 100644 src/components-examples/aria/combobox/combobox-disabled/combobox-disabled.example.ts diff --git a/src/components-examples/aria/combobox/combobox-disabled/combobox-disabled-example.html b/src/components-examples/aria/combobox/combobox-disabled/combobox-disabled-example.html new file mode 100644 index 000000000000..c8e661e2f9e5 --- /dev/null +++ b/src/components-examples/aria/combobox/combobox-disabled/combobox-disabled-example.html @@ -0,0 +1,17 @@ +
+
+ + +
+ +
+ + +
+
diff --git a/src/components-examples/aria/combobox/combobox-disabled/combobox-disabled.example.ts b/src/components-examples/aria/combobox/combobox-disabled/combobox-disabled.example.ts new file mode 100644 index 000000000000..92793632af31 --- /dev/null +++ b/src/components-examples/aria/combobox/combobox-disabled/combobox-disabled.example.ts @@ -0,0 +1,21 @@ +/** + * @license + * Copyright Google LLC All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.dev/license + */ + +import {Combobox, ComboboxInput, ComboboxPopupContainer} from '@angular/aria/combobox'; +import {Component, signal} from '@angular/core'; + +/** @title Combobox disabled example. */ +@Component({ + selector: 'combobox-disabled-example', + templateUrl: 'combobox-disabled-example.html', + styleUrl: '../combobox-examples.css', + imports: [Combobox, ComboboxInput, ComboboxPopupContainer], +}) +export class ComboboxDisabledExample { + searchString = signal('Search is disabled'); +} diff --git a/src/components-examples/aria/combobox/combobox-examples.css b/src/components-examples/aria/combobox/combobox-examples.css index 54e96b72490d..5fc4dd1ad61c 100644 --- a/src/components-examples/aria/combobox/combobox-examples.css +++ b/src/components-examples/aria/combobox/combobox-examples.css @@ -147,3 +147,14 @@ ul[role='group'] { .example-tree-item[aria-selected='true'] .example-selected-icon { visibility: visible; } + +[ngCombobox][aria-disabled='true'] { + opacity: 0.5; + pointer-events: none; + cursor: default; +} + +[ngCombobox][aria-disabled='true'] input.example-combobox-input { + color: var(--mat-sys-on-surface-variant); + background-color: var(--mat-sys-surface); +} \ No newline at end of file diff --git a/src/components-examples/aria/combobox/index.ts b/src/components-examples/aria/combobox/index.ts index ca1e1f5c5dde..c026083346c7 100644 --- a/src/components-examples/aria/combobox/index.ts +++ b/src/components-examples/aria/combobox/index.ts @@ -4,3 +4,4 @@ export {ComboboxHighlightExample} from './combobox-highlight/combobox-highlight- export {ComboboxTreeManualExample} from './combobox-tree-manual/combobox-tree-manual-example'; export {ComboboxTreeAutoSelectExample} from './combobox-tree-auto-select/combobox-tree-auto-select-example'; export {ComboboxTreeHighlightExample} from './combobox-tree-highlight/combobox-tree-highlight-example'; +export {ComboboxDisabledExample} from './combobox-disabled/combobox-disabled.example'; diff --git a/src/dev-app/aria-combobox/combobox-demo.html b/src/dev-app/aria-combobox/combobox-demo.html index 2a5bd48182a0..2e30ec044a52 100644 --- a/src/dev-app/aria-combobox/combobox-demo.html +++ b/src/dev-app/aria-combobox/combobox-demo.html @@ -29,5 +29,10 @@

Combobox with tree popup and auto-select filtering

Combobox with tree popup and highlight filtering

+ +
+

Combobox disabled example

+ +
diff --git a/src/dev-app/aria-combobox/combobox-demo.ts b/src/dev-app/aria-combobox/combobox-demo.ts index a013d1dc1f5f..9961d057c20a 100644 --- a/src/dev-app/aria-combobox/combobox-demo.ts +++ b/src/dev-app/aria-combobox/combobox-demo.ts @@ -8,6 +8,7 @@ import { ComboboxAutoSelectExample, + ComboboxDisabledExample, ComboboxHighlightExample, ComboboxManualExample, ComboboxTreeAutoSelectExample, @@ -26,6 +27,7 @@ import {ChangeDetectionStrategy, Component} from '@angular/core'; ComboboxTreeManualExample, ComboboxTreeAutoSelectExample, ComboboxTreeHighlightExample, + ComboboxDisabledExample, ], changeDetection: ChangeDetectionStrategy.OnPush, }) From 116fd727e6564f363acf8062a1c47e76826e4e19 Mon Sep 17 00:00:00 2001 From: Joy Serquina Date: Wed, 22 Oct 2025 16:25:15 +0000 Subject: [PATCH 3/3] refactor(aria/combobox): fix lint errors Updates .css file to fix lint errors. --- src/components-examples/aria/combobox/combobox-examples.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components-examples/aria/combobox/combobox-examples.css b/src/components-examples/aria/combobox/combobox-examples.css index 5fc4dd1ad61c..01f9237cd28a 100644 --- a/src/components-examples/aria/combobox/combobox-examples.css +++ b/src/components-examples/aria/combobox/combobox-examples.css @@ -156,5 +156,5 @@ ul[role='group'] { [ngCombobox][aria-disabled='true'] input.example-combobox-input { color: var(--mat-sys-on-surface-variant); - background-color: var(--mat-sys-surface); -} \ No newline at end of file + background-color: var(--mat-sys-surface); +}