Components: shouldPlaceholderFloat doesn't work

Created on 31 Oct 2017  路  11Comments  路  Source: angular/components

Bug, feature request, or proposal:

Bug

What is the expected behavior?

Place holder should not float on focus.

What is the current behavior?

Placeholder floats on focus.

What are the steps to reproduce?

using master latest, this does not work to stop floating placeholder and it should based on docs:
```


Most helpful comment

Try with [shouldPlaceholderFloat]="false"
Without [] you pass false as a string.
Also, you should use floatPlaceholder from mat-form-field instead
https://material.angular.io/components/form-field/overview#floating-placeholder

All 11 comments

Try with [shouldPlaceholderFloat]="false"
Without [] you pass false as a string.
Also, you should use floatPlaceholder from mat-form-field instead
https://material.angular.io/components/form-field/overview#floating-placeholder

Closing as this should be managed through mat-form-field

@Wykks I don't think [shouldPlaceholderFloat]="false" works. Not sure why it is still in the documentation: https://material.angular.io/components/input/api

shouldPlaceholderFloat: boolean is deprecated. Not sure if there are any other alternatives..

You can use floatLabel: FloatLabelType now.

What are the possible values of FloatLabelType ?

Should be added to docs properly

For anyone curios, if you actualy dont want floating placeholder OR floating label, use this:
<mat-form-field floatLabel="never"> <input placeholder="My Placeholder" matInput> </mat-form-field>

Very badly described in the docs, sadly!

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._

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Miiekeee picture Miiekeee  路  3Comments

vitaly-t picture vitaly-t  路  3Comments

xtianus79 picture xtianus79  路  3Comments

dzrust picture dzrust  路  3Comments

michaelb-01 picture michaelb-01  路  3Comments