angular / angular/components

bug(many): duplicate code for exposing overlays for modals

Offen
#26,853 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Accessibility area: many P4 refactoring
Vorherrschende Sprache
TypeScript
Sterne
25k
Forks
6.8k
Ø Merge
1 T. 8 Std.
Gemergte PRs (30 T.)
91

Beschreibung

### 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

We have duplicated code for logic for exposing overlays to modals. some browsers won't expose the accessibility node of the overlay if there is an `aria-modal` and the live element is outside of it. This method works around the issue by pointing the `aria-owns` of all modals to the live element.

Action item to consider de-duplicating this with the `LiveAnnouncer` and any other occurrences.

Note that the selector here is limited to CDK overlays at the moment in order to reduce the section of the DOM we need to look through. This should cover all the cases we support, but the selector can be expanded if it turns out to be too narrow.

### Reproduction

Search codebase for TODOS references this issue report.

```
git grep 'TODO(http://github.com/angular/components/issues/26853)'; git grep '#26853';
```

### Expected Behavior

no occurrences

### Actual Behavior

multiple occurrences

### Environment

N/A

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Run the two git grep commands from the issue to locate every TODO reference to #26853, then read the surrounding overlay and LiveAnnouncer logic. Consolidate the duplicated overlay-exposure handling without changing supported CDK overlay behavior; done means both searches return no occurrences and the relevant tests pass.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
typescript
Bereich
accessibility, frontend
Issue-Typ
Refactoring
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
48/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.