I use floatLabel property of mat-form-field, but it doesn't work.
<mat-form-field [floatLabel]='always'>
<mat-label>CyberSource Reference</mat-label>
<input matInput placeholder="(Enter reference)" />
</mat-form-field>
It has 'CyberSource Reference' as placeholder. Then it move to label on focus. Behavior doesn't change with any value of floatLabel property. Any Ideas? MatFormFieldModule is loaded to my app. Thanks.
"@angular/material": "^5.0.4"
This is just a syntax error:
<mat-form-field floatLabel="always">
or
<mat-form-field [floatLabel]="'always'">
Yes, it is true, thank you -_-
this` is my code.on focus it chages to lable.it is driving me crazy now. acn anyone plaese tell me what am i doing wrong?
<mat-form-field floatLabel="never" style="background: transparent;border: 0px">
<mat-select style="height: 30px;" (selectionChange)="add($event)">
<mat-option *ngFor="let smartGroup of smartGroups" [value]="smartGroup.groupId">
xyz
</mat-option>
</mat-select>
<mat-label class="my-class-name">{{'select a group' |translate}}</mat-label>
</mat-form-field>
You saved my hours. Thanks.
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._
Most helpful comment
This is just a syntax error:
or