You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug(md-input) placeholder hidden underneath input with no value #3196
I can't see anything that could be doing it. I've stripped my app back completely so that the core view is just this repro, and removed all CSS, still happening
I have the same issue Chrome 56, Windows 10. After playing with it for a while the problem seems to be related to position: absolute from .mat-input-placeholder.
I can see the label in the plunker above though, so it's a bit weird. However, the labels were fine in beta1. Can you see any problem with this code?
We did some changes to the .mat-input-placeholder in beta.2 in order to prevent it from overflowing in IE 11. Still, my best guess is that there's something else influencing it, because I can't reproduce it in a Plunkr or against our development app.
Below are the 2 images of my code and the result of that code in the browser.
When i reload my login page, only the Sub-domain placeholder is visible, others are visible once you click on them.
I have the same problem, I am trying to clear a reactive form and simple rebuild the form, It clears the fields but anything that had a value is only an underline. If I click in it and then click away the placeholder returns as it should.
I am having the same issue and it is not the result of the missing DOCTYPE or the BrowserAnimationModule not being present.
Issue description
If I use one of the stock angular material themes such as: @import '~@angular/material/prebuilt-themes/deeppurple-amber.css';
... my inputs appear as follows...
... as soon as I try to implement a custom theme, here is what happens:
... as you can see, its basically the same the others who are experiencing the same issue... the matInputs are there but invisible.
Clicking into them does begin the animation and properly display them (one at a time).
I have the same problem as @stwalter01
After .patchValue() on react form, labels still have class ".mat-empty .mat-form-field-empty". Then, when I focus input field ".mat-empty .mat-form-field-empty" class is removed from the label. After clear all form (by [FormGroup].reset()), placeholder from previously focued field dissapear, because this field doesn't have ".mat-empty" class anymore.
I notice this only after .patchValue() on form. When I fill form manually and then do .reset(), labels are properly chcecked and ".mat-empty" class is present.
Activity
benb7760 commentedon Feb 19, 2017
Update - it appears to be resolved by reverting:
.mat-input-placeholder-wrapper::aftercontentfrom '' back to '\00a0'crisbeto commentedon Feb 19, 2017
The issue with reverting the content back to
\00a0is that the browser can end up rendering it in some cases (AFAIK Chrome on Linux is one of them).Also, if you're unable to reproduce it in a Plunkr, can you post a screenshot of what it looks like?
benb7760 commentedon Feb 19, 2017
Update - I have disabled all custom CSS and can confirm that this still happens.
No selection

Selection

crisbeto commentedon Feb 19, 2017
Hmm that's weird. What OS and browser are you using?
benb7760 commentedon Feb 19, 2017
Tested in both Chrome 56, Safari 10.0.3. I have also cleared node_modules and reinstalled and continue to see the same issue
crisbeto commentedon Feb 19, 2017
I couldn't reproduce it with neither of those browsers. Are you sure there isn't anything else in your app that could be messing with it?
benb7760 commentedon Feb 19, 2017
I can't see anything that could be doing it. I've stripped my app back completely so that the core view is just this repro, and removed all CSS, still happening
lukaskopenec commentedon Feb 20, 2017
I have the same issue Chrome 56, Windows 10. After playing with it for a while the problem seems to be related to
position: absolutefrom.mat-input-placeholder.I can see the label in the plunker above though, so it's a bit weird. However, the labels were fine in beta1. Can you see any problem with this code?
<form (ngSubmit)="logIn()" novalidate #loginForm="ngForm"><md-input-container><input mdInput type="text" md-input placeholder="Username" [(ngModel)]="username" name="username" required></md-input-container></form>crisbeto commentedon Feb 20, 2017
We did some changes to the
.mat-input-placeholderin beta.2 in order to prevent it from overflowing in IE 11. Still, my best guess is that there's something else influencing it, because I can't reproduce it in a Plunkr or against our development app.crisbeto commentedon Feb 20, 2017
Actually, I think I found what may be causing it. Can @lukaskopenec and @benb7760 check that your index.html has a doctype?
lukaskopenec commentedon Feb 20, 2017
@crisbeto That was it! I had a doctype but with a typo. Thanks for your help!
benb7760 commentedon Feb 20, 2017
@crisbeto Yep that has solved it here too. My DOCTYPE had some extra stuff in it which I have since removed. For reference, it looked like this;
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">and I have changed it to
<!DOCTYPE html>naiteluo commentedon Feb 21, 2017
I have the same issue. In my case, i forgot to add
<!DOCTYPE html>in front of the html tag, after i add the correct doctype, problem solved.kara commentedon Feb 21, 2017
Okay, it looks like this issue was solved by fixing the DOCTYPE? Will close then.
7 remaining items
willshowell commentedon Sep 1, 2017
@mayankjoshi24 can you reproduce and open a separate issue?
xtianus79 commentedon Sep 1, 2017
@mayankjoshi24 is this the bug wher eyou need to have this in your index.html file?
i.e. html5
mayankjoshi24 commentedon Sep 4, 2017
Below are the 2 images of my code and the result of that code in the browser.
When i reload my login page, only the Sub-domain placeholder is visible, others are visible once you click on them.
stwalter01 commentedon Nov 1, 2017
I have the same problem, I am trying to clear a reactive form and simple rebuild the form, It clears the fields but anything that had a value is only an underline. If I click in it and then click away the placeholder returns as it should.
bertyhell commentedon Nov 18, 2017
I had the same issue unrelated to the html doctype
The problem was solved by importing the animation module.
source: https://stackoverflow.com/a/43241908/373207
codemental commentedon Dec 1, 2017
I have the exact same situation as @stwalter01. I have a form inside a mat-card-content like this:
If the form shows some data and afterwards I clear it with an empty object like this:
the form looks like this:


instead of this:
If I refresh the app (CTRL-F5) the form appears correctly. This problem only appears if I navigate to it from somewhere else.
I have the doctype declaration and the BrowserAnimationsModule import.
OS: Linux Ubuntu 17.10
Browsers: Latest Firefox Quantum: Developer Edition and latest Chrome.
rcanacci commentedon Dec 12, 2017
I am having the same issue and it is not the result of the missing DOCTYPE or the BrowserAnimationModule not being present.
Issue description
If I use one of the stock angular material themes such as:
@import '~@angular/material/prebuilt-themes/deeppurple-amber.css';
... my inputs appear as follows...
... as soon as I try to implement a custom theme, here is what happens:
... as you can see, its basically the same the others who are experiencing the same issue... the matInputs are there but invisible.
Clicking into them does begin the animation and properly display them (one at a time).
maknik commentedon Dec 13, 2017
I have the same problem as @stwalter01
After .patchValue() on react form, labels still have class ".mat-empty .mat-form-field-empty". Then, when I focus input field ".mat-empty .mat-form-field-empty" class is removed from the label. After clear all form (by [FormGroup].reset()), placeholder from previously focued field dissapear, because this field doesn't have ".mat-empty" class anymore.
I notice this only after .patchValue() on form. When I fill form manually and then do .reset(), labels are properly chcecked and ".mat-empty" class is present.
rcanacci commentedon Dec 13, 2017
Hey, @maknik, the issue has been re-opened here:
#8960
maknik commentedon Dec 13, 2017
@rcanacci but #8960 is about hidden fields not about hidden placeholder. I'm not sure this is the same problem
rcanacci commentedon Dec 13, 2017
@maknik - no problem, just a good heads up then that this issue is closed. I was advised to open a new one. Cheers!
dhananshan commentedon Apr 8, 2018
easy fix could be applying the below in your global CSS file. This will overwrite the
abparasar commentedon Aug 13, 2018
This may happen when your padding properties are messing with the padding of the placeholder text.
Try this if it helps:
.mat-form-field-placeholder {
padding: 0px !important;
}
angular-automatic-lock-bot commentedon Sep 9, 2019
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.