File tree 3 files changed +16
-30
lines changed
3 files changed +16
-30
lines changed Original file line number Diff line number Diff line change @@ -221,6 +221,15 @@ <h4>Textarea</h4>
221
221
< md-hint align ="end "> {{hintLabelWithCharCount.value.length}}</ md-hint >
222
222
</ md-input-container >
223
223
</ p >
224
+ < p >
225
+ < md-input-container style ="margin-bottom: 2em ">
226
+ < textarea mdInput #longHint placeholder ="Enter text to count "> </ textarea >
227
+ < md-hint >
228
+ Enter some text to count how many characters are in it. The character count is shown on the right.
229
+ </ md-hint >
230
+ < md-hint align ="end " style ="white-space: nowrap "> Length: {{longHint.value.length}}</ md-hint >
231
+ </ md-input-container >
232
+ </ p >
224
233
< p >
225
234
< md-checkbox [(ngModel)] ="color "> Check to change the color:</ md-checkbox >
226
235
< md-input-container [color] ="color ? 'primary' : 'accent' ">
Original file line number Diff line number Diff line change 44
44
< div class ="mat-input-hint-wrapper " *ngSwitchCase ="'hint' "
45
45
[@transitionMessages] ="_subscriptAnimationState ">
46
46
< div *ngIf ="hintLabel " [id] ="_hintLabelId " class ="mat-hint "> {{hintLabel}}</ div >
47
- < ng-content select ="md-hint, mat-hint "> </ ng-content >
47
+ < ng-content select ="md-hint:not([align='end']), mat-hint:not([align='end']) "> </ ng-content >
48
+ < div class ="mat-input-hint-spacer "> </ div >
49
+ < ng-content select ="md-hint[align='end'], mat-hint[align='end'] "> </ ng-content >
48
50
</ div >
49
51
</ div >
50
52
</ div >
Original file line number Diff line number Diff line change 5
5
6
6
$mat-input-floating-placeholder-scale-factor : 0.75 !default ;
7
7
$mat-input-wrapper-spacing : 1em !default ;
8
+ $mat-input-hint-min-space : 10px !default ;
8
9
9
10
// Gradient for showing the dashed line when the input is disabled.
10
11
$mat-input-underline-disabled-background-image :
@@ -236,37 +237,11 @@ $mat-input-underline-disabled-background-image:
236
237
237
238
// Clears the floats on the hints. This is necessary for the hint animation to work.
238
239
.mat-input-hint-wrapper {
239
- & ::before ,
240
- & ::after {
241
- content : ' ' ;
242
- display : table ;
243
- }
244
-
245
- & ::after {
246
- clear : both ;
247
- }
240
+ display : flex ;
248
241
}
249
242
250
- // The hint is shown below the underline. There can be
251
- // more than one; one at the start and one at the end.
252
- .mat-hint {
253
- display : block ;
254
- float : left ;
255
-
256
- // We use floats here, as opposed to flexbox, in order to make it
257
- // easier to reverse their location in rtl and to ensure that they're
258
- // aligned properly in some cases (e.g. when there is only an `end` hint).
259
- & .mat-right {
260
- float : right ;
261
- }
262
-
263
- [dir = ' rtl' ] & {
264
- float : right ;
265
-
266
- & .mat-right {
267
- float : left ;
268
- }
269
- }
243
+ .mat-input-hint-spacer {
244
+ flex : 1 0 $mat-input-hint-min-space ;
270
245
}
271
246
272
247
// Single error message displayed beneath the input.
You can’t perform that action at this time.
0 commit comments