Open aitboudad opened 4 years ago
Please note that there is also a second, possibly connected issue, with the autocomplete control. When an initial selection is applied (programmatically), the mat-selected class is not set.
Reproduction steps (also see connected and referenced ticket with simple demo solution):
Replace model = { }; with model = { state: "Alabama" };
Expected behavior: the .mat-selected class is applied, the selected item has a red background
Actual behavior: the .mat-selected class is not applied, the selected item looks just like the others and has a white background.
Reproduction
When an autocomplete control is reset, the selected option still hold the
.mat-selected
class.https://stackblitz.com/edit/angular-ufhza2 Steps to reproduce:
1) Open the autocomplete 2) Select an entry 3) Click reset 4) Open the autocomplete again
Expected Behavior
mat-selected
class should be removed when autocomplete is emptyEnvironment
10.2.0
10.2.5