bug(autocomplete/select): Icons inside `mat-option` no longer vertically aligned
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.x
Description
[Regression between legacy implementation and new MDC implementation]
In the legacy implementation, icons placed inside mat-options were correctly vertically aligned by default. In the new MDC implementation this is no longer the case.
Unlike the MDC menu item icons, mat-option icons will be rendered inside the list item text region, so they do not get aligned by the flexbox. This means that adding the matListItemIcon directive doesn't help either.
As an aside, it is unclear to me whether the list item directives should be supported inside mat-option. If not, will we have to wait for option-specific analogs for each of these directives to become available?
Reproduction
Correct vertical alignment with legacy implementation: https://stackblitz.com/edit/angular-vcdh27-b2futv?file=src/app/select-overview-example.ts
Incorrect vertical alignment with MDC implementation: https://stackblitz.com/edit/angular-vcdh27?file=src/app/select-overview-example.ts
Expected Behavior
Either
- the alignment behavior should be unchanged, or
- the change in behavior should be documented in the changelog
Actual Behavior
The aligment is different and this is not mentioned in the changelog or migration guide
Environment
- Angular: 15.0.0
- CDK/Material: 15.0.0
- Browser(s): Chrome
- Operating System (e.g. Windows, macOS, Ubuntu): Windows
Same problem with Tabs
https://material.angular.io/components/tabs/examples#tab-group-custom-label https://v14.material.angular.io/components/tabs/examples#tab-group-custom-label
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.