question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

matInput don`t float placeholder

See original GitHub issue

Bug, feature request, or proposal:

any element that supports ‘matInput’ have problem with placeholder.

What is the expected behavior?

placeholder should float to top when input is focused

What is the current behavior?

placeholder stands on his previous position and overlaps with text in input

![Image of Yaktocat] (https://image.ibb.co/iHs3MG/2017_10_09_19_12_51.png)

What are the steps to reproduce?

Insert this html code into page:

<form #editTaskForm="ngForm">
        <mat-form-field>
            <input matInput type="text" placeholder="Название" [(ngModel)]="model.Title" name="Title" #Title="ngModel" required [disabled]="userRole == 'assignedTo'">
        </mat-form-field>
        <mat-form-field class="example-full-width">
            <textarea matInput rows="5" placeholder="Описание" [(ngModel)]="model.Description" name="Description" #Description="ngModel" [disabled]="userRole == 'assignedTo'"></textarea>
        </mat-form-field>
</form> 

What is the use-case or motivation for changing an existing behavior?

It is very important, because it destroys all design in forms! It is annoyin, when you are updating to upper version and something simple fails!

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

“dependencies”: { “@angular/animations”: “^4.4.2”, “@angular/cdk”: “^2.0.0-beta.12”, “@angular/common”: “^4.4.2”, “@angular/compiler”: “^4.4.2”, “@angular/core”: “^4.4.2”, “@angular/forms”: “^4.4.4”, “@angular/http”: “^4.4.2”, “@angular/material”: “^2.0.0-beta.12”, “@angular/platform-browser”: “^4.4.2”, “@angular/platform-browser-dynamic”: “^4.4.2”, “@angular/router”: “^4.4.2”, “classlist.js”: “^1.1.20150312”, “core-js”: “^2.5.1”, “intl”: “^1.2.5”, “ng2-dragula”: “^1.5.0”, “rxjs”: “^5.4.2”, “web-animations-js”: “^2.3.1”, “zone.js”: “^0.8.14” }, “devDependencies”: { “@angular/cli”: “1.4.2”, “@angular/compiler-cli”: “^4.4.2”, “@angular/language-service”: “^4.4.2”, “@types/jasmine”: “~2.6.0”, “@types/jasminewd2”: “^2.0.3”, “@types/node”: “^8.0.28”, “codelyzer”: “~3.2.0”, “jasmine-core”: “~2.8.0”, “jasmine-spec-reporter”: “~4.2.1”, “karma”: “^1.7.1”, “karma-chrome-launcher”: “~2.2.0”, “karma-cli”: “~1.0.1”, “karma-coverage-istanbul-reporter”: “^1.2.1”, “karma-jasmine”: “~1.1.0”, “karma-jasmine-html-reporter”: “^0.2.2”, “protractor”: “~5.1.2”, “ts-node”: “~3.3.0”, “tslint”: “~5.7.0”, “typescript”: “~2.5.2” }

Is there anything else we should know?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:4
  • Comments:11 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
thieneditscommented, Mar 8, 2019

doesnt seem to be working. Im on 7.3.0 and its still floating placeholder.

seems to only work if you use <mat-form-field floatLabel="never" >

2reactions
leolanesecommented, Aug 30, 2018

use: <mat-form-field floatPlaceholder="never" >

Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular/Material mat-form-field input - Floating label issues
However the form field now supports both floating labels and placeholders. Therefore in the non-legacy appearances the never option has been ...
Read more >
Turning off the Floating Placeholder on Angular Material Input ...
When we click on an Angular Material input field the placeholder label floats to the top. We want to turn this off. Approach....
Read more >
Form field - Angular Material
Floating label. The floating label is a text label displayed on top of the form field control when the control does not contain...
Read more >
Switching Off the Float Label of Our Angular Material Form Field
And we want to turn off the floating label. Approach. Just add floatLabel='never' . <mat-form-field floatLabel='never'> <input matInput placeholder ...
Read more >
Input label does not move up when value or placeholder is sp
In Your case I suggest to replace label by the placeholder attribute. ... Is like if the field has data controlled by formcontrol...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found