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 1414 #fallbackOverlayOrigin ="cdkOverlayOrigin "
1515 #trigger >
1616 < 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 >
1818 < 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 >
2020 < ng-content select ="mat-select-trigger " *ngSwitchCase ="true "> </ ng-content >
2121 </ span >
2222 </ div >
Original file line number Diff line number Diff line change @@ -144,3 +144,12 @@ $scale: 0.75 !default;
144144 }
145145 }
146146}
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 1414 #origin ="cdkOverlayOrigin "
1515 #trigger >
1616 < 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 >
1818 < 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 >
2020 < ng-content select ="mat-select-trigger " *ngSwitchCase ="true "> </ ng-content >
2121 </ span >
2222 </ 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
147147 display : block ;
148148 }
149149}
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