angular / angular/components

menu: trigger ExpressionChangedAfterItHasBeenCheckedError aria-expanded: null in OnPush component

Aperta
#14,440 9 commenti 14 reazioni 0 assegnatari Vedi su GitHub
area: material/menu P3
Lingua principale
TypeScript
Stelle
25k
Fork
6.8k
Merge medio
1g 8h
PR unite (30g)
91

Descrizione

#### What is the expected behavior?
Error should not occur

#### What is the current behavior?
Repeatedly and quickly clicking on menu trigger button causes error

#### What are the steps to reproduce?
[StackBlitz](https://stackblitz.com/edit/angular-stgyux)
Click on menuTrigger repeatedly -> error shows in console

#### Which versions of Angular, Material, OS, TypeScript, browsers are affected?
Angular 7.1.0
Angular Material 7.1.0
Chrome Browser

#### Is there anything else we should know?
ChangeDetection: OnPush

ERROR
Error: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: 'aria-expanded: true'. Current value: 'aria-expanded: null'.

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia dalla riproduzione StackBlitz collegata usando Angular e Angular Material 7.1.0, quindi fai clic ripetutamente sul trigger del menu in un componente OnPush mentre osservi la console. Traccia le modifiche di aria-expanded del trigger del menu e determina perché il valore verificato cambia in null; il lavoro è completato quando la riproduzione non segnala più ExpressionChangedAfterItHasBeenCheckedError.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
angular, typescript
Ambito
frontend
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
38/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.