Angular Material: How to set floatPlaceholder to never

Library: Angular Material ( material2 )

I would like to use the mdInputContainer floatPlaceholder directive so that the placeholder / tooltip never floats.

I can't see where he is specifying the values ​​he expects in the documentation:

@Input () floatPlaceholder: Whether the placeholder should always float, never float, or float as the user input.

taken from: https://material.angular.io/components/input/api

<md-input-container [floatPlaceholder]="false"> <input type="text" mdInput placeholder="Search..." </md-input-container>

I tried false

and "never"

for the values as my best guesses, but prevents the filler was floating above the entrance.

+3


source to share


1 answer


You can set the input floatPlaceholder to auto, always, never.

<md-input-container floatPlaceholder="never">
          <input type="text"
                 mdInput
                 placeholder="Search...">
</md-input-container>

      



An example of a plunger.

+4


source







All Articles