angular / angular/components

bug(mat-select): wrong initial values when using async object property

Ouverte
#27,220 4 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
area: material/select P3
Langage dominant
TypeScript
Étoiles
25k
Forks
6.8k
Merge moyen
1 j 8 h
PR mergées (30 j)
91

Description

### Is this a regression?

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

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

14.2.12

### Description

Hey everyone, if I try to access a property of an object loaded with the async pipe it appears to be empty until I click inside the mat-select element.

It's hard to explain so there's a stackblitz to show the issue.

### Reproduction

https://stackblitz.com/edit/rjpwlz?file=src%2Fexample%2Fselect-no-ripple-example.html

### Expected Behavior

The first mat-select in the example should initially display "2"

### Actual Behavior

The first mat-select seems empty until you click on it

### Environment

- Angular: 16.0.4
- CDK/Material: 16.0.3
- Browser(s): Chrome 113.0.5672.127
- Operating System (e.g. Windows, macOS, Ubuntu): Windows 11

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Commencez par la reproduction StackBlitz liée et vérifiez le comportement avec Angular 16.0.4 et CDK/Material 16.0.3. Comparez le rendu initial du premier mat-select avec le comportement précédent de 14.2.12, et considérez le problème comme terminé lorsque la propriété asynchrone de l’objet affiche initialement "2" sans cliquer sur le select.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
angular, typescript
Domaine
frontend
Type d'issue
Bug
Difficulté
3/5
Temps estimé
1-2 jours
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
35/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.