shouldPlaceholderFloat doesn't work
See original GitHub issueBug, 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:
<mat-form-field>
<input matInput type="text" placeholder="Alias name" shouldPlaceholderFloat="false">
</mat-form-field>
Issue Analytics
- State:
- Created 6 years ago
- Comments:11 (2 by maintainers)
Top Results From Across the Web
floating label not working correctly with not(:placeholder-shown)
currently I'm implementing a simple floating label ...
Read more >Floating labels are problematic. After writing Placeholders are…
They have poor contrast Like placeholder text, floating labels have low contrast to differentiate it but low contrast text is hard-to-read. ...
Read more >Don't Use The Placeholder Attribute - Smashing Magazine
This little trick provides an extra area for interacting with the input, which can be beneficial to people with motor control issues.
Read more >The Anatomy of Accessible Forms - Deque Systems
According to the research conducted by Nielsen, it is not best practice to have a placeholder in the form field from a user...
Read more >Material Design Style: Placeholder should float to top and not ...
When using the placeholder, the placeholder correctly floats to the top of the autocomplete, but then disappears once the value has been ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Try with
[shouldPlaceholderFloat]="false"
Without[]
you passfalse
as a string. Also, you should usefloatPlaceholder
from mat-form-field instead https://material.angular.io/components/form-field/overview#floating-placeholderYou can use
floatLabel: FloatLabelType
now.