Issue
Is there any way in which I can stop the placeholder from floating as a label for the following snippet of code?
<form class="search-form">
<mat-form-field class="example-full-width">
<input class="toolbar-search" type="text" matInput>
<mat-placeholder>Search</mat-placeholder>
<mat-icon matSuffix style="font-size: 1.2em">search</mat-icon>
</mat-form-field>
</form>
I have looked at the official documentation for angular/material, but it seems this feature is now deprecated?
Solution
assuming you are using latest stable version of material 2,
you can use floatLabel="never" to force label to not to float.
here is live working demo
this is clear in documentation https://material.angular.io/components/form-field/api
Answered By - Praveen Soni
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.