Skip to content

Commit ff8988e

Browse files
committed
fix(material/core): icons not aligned inside mat-option
Fixes that icons projected inside an MDC-based `mat-option` weren't centered and didn't have the correct margin like the non-MDC version. Fixes #26024.
1 parent 57676e4 commit ff8988e

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/material/core/option/option.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<mat-pseudo-checkbox *ngIf="multiple" class="mat-mdc-option-pseudo-checkbox"
22
[state]="selected ? 'checked' : 'unchecked'" [disabled]="disabled"></mat-pseudo-checkbox>
33

4+
<ng-content select="mat-icon"></ng-content>
5+
46
<span class="mdc-list-item__primary-text"><ng-content></ng-content></span>
57

68
<!-- See a11y notes inside optgroup.ts for context behind this element. -->

src/material/core/option/option.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,10 @@
4646
}
4747
}
4848

49+
.mat-icon,
4950
.mat-pseudo-checkbox {
5051
margin-right: mdc-list-variables.$side-padding;
52+
flex-shrink: 0;
5153

5254
[dir='rtl'] & {
5355
margin-right: 0;

0 commit comments

Comments
 (0)