File tree Expand file tree Collapse file tree 4 files changed +22
-4
lines changed
material-experimental/mdc-select Expand file tree Collapse file tree 4 files changed +22
-4
lines changed Original file line number Diff line number Diff line change 14
14
#fallbackOverlayOrigin ="cdkOverlayOrigin "
15
15
#trigger >
16
16
< div class ="mat-mdc-select-value " [ngSwitch] ="empty " [attr.id] ="_valueId ">
17
- < span class ="mat-mdc-select-placeholder " *ngSwitchCase ="true "> {{placeholder || '\u00A0' }}</ span >
17
+ < span class ="mat-mdc-select-placeholder mat-mdc-select-min-line " *ngSwitchCase ="true "> {{placeholder}}</ span >
18
18
< span class ="mat-mdc-select-value-text " *ngSwitchCase ="false " [ngSwitch] ="!!customTrigger ">
19
- < span *ngSwitchDefault > {{triggerValue || '\u00A0' }}</ span >
19
+ < span class =" mat-mdc-select-min-line " *ngSwitchDefault > {{triggerValue}}</ span >
20
20
< ng-content select ="mat-select-trigger " *ngSwitchCase ="true "> </ ng-content >
21
21
</ span >
22
22
</ div >
Original file line number Diff line number Diff line change @@ -144,3 +144,12 @@ $scale: 0.75 !default;
144
144
}
145
145
}
146
146
}
147
+
148
+ // Used to prevent inline elements from collapsing if their text bindings
149
+ // become empty. This is preferrable to inserting a blank space, because the
150
+ // space can be read out by screen readers (see #21725).
151
+ .mat-mdc-select-min-line :empty ::before {
152
+ content : ' ' ;
153
+ white-space : pre ;
154
+ width : 1px ;
155
+ }
Original file line number Diff line number Diff line change 14
14
#origin ="cdkOverlayOrigin "
15
15
#trigger >
16
16
< div class ="mat-select-value " [ngSwitch] ="empty " [attr.id] ="_valueId ">
17
- < span class ="mat-select-placeholder " *ngSwitchCase ="true "> {{placeholder || '\u00A0' }}</ span >
17
+ < span class ="mat-select-placeholder mat-select-min-line " *ngSwitchCase ="true "> {{placeholder}}</ span >
18
18
< span class ="mat-select-value-text " *ngSwitchCase ="false " [ngSwitch] ="!!customTrigger ">
19
- < span *ngSwitchDefault > {{triggerValue || '\u00A0' }}</ span >
19
+ < span class =" mat-select-min-line " *ngSwitchDefault > {{triggerValue}}</ span >
20
20
< ng-content select ="mat-select-trigger " *ngSwitchCase ="true "> </ ng-content >
21
21
</ span >
22
22
</ div >
Original file line number Diff line number Diff line change @@ -147,3 +147,12 @@ $mat-select-placeholder-arrow-space: 2 * ($mat-select-arrow-size + $mat-select-a
147
147
display : block ;
148
148
}
149
149
}
150
+
151
+ // Used to prevent inline elements from collapsing if their text bindings
152
+ // become empty. This is preferrable to inserting a blank space, because the
153
+ // space can be read out by screen readers (see #21725).
154
+ .mat-select-min-line :empty ::before {
155
+ content : ' ' ;
156
+ white-space : pre ;
157
+ width : 1px ;
158
+ }
You can’t perform that action at this time.
0 commit comments