-
Notifications
You must be signed in to change notification settings - Fork 6.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug(md-input) placeholder hidden underneath input with no value #3196
Comments
Update - it appears to be resolved by reverting: |
The issue with reverting the content back to Also, if you're unable to reproduce it in a Plunkr, can you post a screenshot of what it looks like? |
Hmm that's weird. What OS and browser are you using? |
Tested in both Chrome 56, Safari 10.0.3. I have also cleared node_modules and reinstalled and continue to see the same issue |
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? |
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
|
We did some changes to the |
Actually, I think I found what may be causing it. Can @lukaskopenec and @benb7760 check that your index.html has a doctype? |
@crisbeto That was it! I had a doctype but with a typo. Thanks for your help! |
@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;
and I have changed it to
|
I have the same issue. In my case, i forgot to add |
Okay, it looks like this issue was solved by fixing the DOCTYPE? Will close then. |
can i just make the notation here that quickstart... lol, which I started my projects from must have not had it in there. just sayin!!! |
I had these symptoms, but it was unrelated to the DOCTYPE. See http://plnkr.co/edit/fElo3SpEtDA5Fy4oLoHb?p=preview for an example Enclosing the form within a container or adding the class 'mat-app-background' to the |
had the same problem, I didnt even have a doctype on my index page!! problem solved when i added it |
The same problem on Firefox 53.0.2 placeholder is shown when property of css class is disabled .mat-input-placeholder-wrapper - overflow: hidden As written in previous post by @Gallopaway - works properly after adding doctype |
Like @Stexxen, I also experience these symtoms unrelated to the doctype. Without a wrapper like md-card, the input field doesn't have the required behaviour with all themes: |
Its happening with me too. Quite irritated by this bug or tweak , whatever it may be! |
@mayankjoshi24 can you reproduce and open a separate issue? |
@mayankjoshi24 is this the bug wher eyou need to have this in your index.html file?
i.e. html5 |
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 had the same issue unrelated to the html doctype The problem was solved by importing the animation module. @NgModule({
declarations: [
...
],
imports: [
BrowserAnimationsModule,
...
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { } |
I have the exact same situation as @stwalter01. I have a form inside a mat-card-content like this: <mat-card-content>
<form [formGroup]="formGroup">
...
</form>
</mat-card-content> If the form shows some data and afterwards I clear it with an empty object like this: let location: Location = new Location();
this.formGroup = new FormGroup({
id: new FormControl(location.id),
created: new FormControl(location.created),
name: new FormControl(location.name, Validators.required),
... the form looks like 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 |
I am having the same issue and it is not the result of the missing DOCTYPE or the BrowserAnimationModule not being present. Issue description ... 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 |
@maknik - no problem, just a good heads up then that this issue is closed. I was advised to open a new one. Cheers! |
easy fix could be applying the below in your global CSS file. This will overwrite the
|
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 { |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Bug, feature request, or proposal:
Bug
What is the expected behavior?
With no value provided, the placeholder should sit in front of the input element
What is the current behavior?
The placeholder is hidden behind the input element. Selecting the element triggers the ordinary animation, moving the placeholder above the input.
What are the steps to reproduce?
http://plnkr.co/edit/VV9wDNx7FIK0gVDWsMU6?p=preview
I was annoyingly unable to reproduce on Plunker. The code in that Plunker does not work on my machine. I am using the material builds repo;
"@angular/material": "git+https://github.com/angular/material2-builds.git#8f246c0"
That exact commit is where the bug first appears for me. I have also tried against the main repo at beta.2 and the same issue occurs
-I can't see any specific CSS being used within my project- I have since removed all of my app content and this still happens with no custom CSS
Which versions of Angular, Material, OS, browsers are affected?
Chrome 56, Safari 10.0.3 (untested elsewhere). Material 2.0.0-beta.2 and material-builds #8f246c0
The text was updated successfully, but these errors were encountered: