From a022acfa273e52c91dc0291b8c34ccfdb8582f79 Mon Sep 17 00:00:00 2001 From: Joy Serquina Date: Wed, 22 Jan 2025 03:10:56 +0000 Subject: [PATCH 1/2] fix(material/chips): update chip-row disabled chip to be focused Updates chip-row element of Angular Components Chip Component to be focusable even if the chip is disabled. This allows the chip to be accessed via screenreader and read aloud as a disabled chip. Fixes b/380373844 --- src/material/chips/chip-row.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/material/chips/chip-row.ts b/src/material/chips/chip-row.ts index 5d819224fca7..34408bae2e9d 100644 --- a/src/material/chips/chip-row.ts +++ b/src/material/chips/chip-row.ts @@ -114,7 +114,7 @@ export class MatChipRow extends MatChip implements AfterViewInit { /** Sends focus to the first gridcell when the user clicks anywhere inside the chip. */ _handleFocus() { - if (!this._isEditing && !this.disabled) { + if (!this._isEditing) { this.focus(); } } From d110db9783524dbf8965b299ed96d2bc4816208e Mon Sep 17 00:00:00 2001 From: Joy Serquina Date: Wed, 22 Jan 2025 18:34:09 +0000 Subject: [PATCH 2/2] refactor(material/chips): updating chips dev-app to add disabled input chips Updates previous chips dev-app demo to include disabled input chips to mimic the XAP demo for a11y testing purposes. --- src/dev-app/chips/chips-demo.html | 68 +++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/src/dev-app/chips/chips-demo.html b/src/dev-app/chips/chips-demo.html index 6011d84cd86c..50d20beaa68b 100644 --- a/src/dev-app/chips/chips-demo.html +++ b/src/dev-app/chips/chips-demo.html @@ -225,6 +225,74 @@

Options

+ + Disabled Input Chips + + +

+ The <mat-chip-grid> component pairs with the matChipInputFor directive + to convert user input text into chips. + They can be used inside a <mat-form-field>. +

+ +

Input is last child of chip grid

+ + + New Contributor... + + @for (person of people; track person) { + + {{person.name}} + + + } + + + + +

Input is next sibling child of chip grid

+ + + New Contributor... + + @for (person of people; track person) { + + {{person.name}} + + + } + + + + +

+ The example above has overridden the [separatorKeys] input to allow for + ENTER, COMMA and SEMICOLON keys. +

+ +

Options

+

+ Add on Blur +

+ +
+
+ Miscellaneous