angular / angular/components

bug(Chip - chip-grid): Error not announced in screen readers on blur

Open
#28,940 0 comments 0 reactions 0 assignees View on GitHub
area: material/chips P3
Dominant language
TypeScript
Stars
25k
Forks
6.8k
Avg merge
1d 8h
Merged PRs (30d)
91

Description

### Is this a regression?

- [ ] Yes, this behavior used to work in the previous version

### The previous version in which this bug was not present was

_No response_

### Description

Due to timeout on `_blur()` function in `chip-grid.ts` the errors that are shown are not announced.
https://github.com/angular/components/blob/main/src/material/chips/chip-grid.ts#L407

![image](https://github.com/angular/components/assets/116736167/27a31548-6cf9-495c-9ab0-37e0930c1e74)

### Reproduction

StackBlitz link: https://stackblitz.com/edit/qmuavp-wu5wvf?file=src%2Fexample%2Fchips-form-control-example.html
Steps to reproduce:
1. Add required form control
2. Blur from the input

### Expected Behavior

Screen reader should read the error shown on blur.

### Actual Behavior

Screen reader isn't reading the error shown on blur.

### Environment

- Angular: "^17.3.0"
- CDK/Material: "17.3.1"
- Browser(s): Chrome
- Operating System (e.g. Windows, macOS, Ubuntu): Windows

Contributor guide

Open the contributing guide

Research direction

Start in src/material/chips/chip-grid.ts around line 407 and reproduce the issue with the linked StackBlitz example using a required form control. Trace the _blur() timeout and verify that the error shown after blurring is announced by a screen reader.

Written by the indexing model from the issue text.

Assessment

Tech stack
angular, typescript
Domain
accessibility, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.