Input and select placeholders are not correctly placed
Bug, feature request, or proposal:
bug
What is the expected behavior?
https://material.angular.io/components/input/overview https://material.angular.io/components/select/overview
What is the current behavior?
Select placeholder has a lot of empty space :
Input placeholder is missplaced: 
What are the steps to reproduce?
Just create a mat-form-field with an input / a select inside, I followed the documentation exemples
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
Angular CLI : 1.4.7 Angular core : 4.4.4 Angular material : 2.0.0-beta.12 OS : Windows 10 x64 / MacOs 10.13
Is there anything else we should know?
Tested on Chrome 61, I don't have this issue with the beta.8
Which browser did you find this? Looks good for me on Opera 48, Chrome 61, and Firefox 56 on Pop_OS (built on Ubuntu) 17.10
Oops, forgot that information. I tested it on Chrome 61
Same issue with mat-select, I see a lot of empty space
<mat-form-field>
<mat-select matInput
placeholder="{{'pass.new.labels.enginetype' | translate }}"
formControlName="engineType"> <mat-option
*ngFor="let engineType of engineTypes" [value]="engineType.value">
{{ engineType.value }} </mat-option> </mat-select>
</mat-form-field>
@Kornhe you're seeing it on the docs site in Chrome 61? Or you're seeing it in your own application? Can you provide a reproduction?
@lippomano do you have any old workarounds that add custom styles to your mat-select? A lot of folks added some css workarounds to keep them consistent until they were aligned natively, which is now the case in beta.12.
@willshowell No, I'm seeing it on my own application, sorry for the confusion. Here is the code :
<mat-form-field color="accent">
<mat-select formControlName="countMethod" placeholder="Mode de décompte">
<mat-option *ngFor="let method of countMethods" [value]="method.value">{{ method.displayValue }}</mat-option>
</mat-select>
</mat-form-field>
This is included in a MatDialog, however, putting it outside does not fix the issue
@Kornhe Are you positive you don't have any overriding css? As I mentioned in my last comment, lots of people added a workaround to align the input and select before it was handled natively. You may have forgotten about some global css you dropped in a while back.
If you're sure, then I don't think there's much the team will be able to do without a reproduction.
@willshowell I'm 100% sure I don't have any css overriding it, I removed all my stylesheets but it gives me the same results.
The select is part of a <form> ... </form>, I don't know if this is an issue but I don't think
I have the same issue.
Can someone experiencing these issues please create a plunker or stackblitz demonstrating it?
I had the same issue, and as @willshowell stated, there was still an old
mat-select {
margin-top: 30px;
}
Deleting my old workaround-line fixed it.
@mmalerba : For the mat-select, @willshowell was right, I had a margin-top leaking on it, causing the spacing. However, the input placeholder is not affected by any css, I double checked for that.
@Kornhe are you using angular 4.4.4 or higher? it contains a fix for a whitespace bug that affected the select placeholder
@mmalerba Yup, but has I said, I fixed the select placeholder, however, I can't find a fix for the input placeholder. This issue appeared when I made the transition to Angular 4.4.4 and Angular Material beta 12
In short, when you perform a transform on the mat-select, the placeholder doesn't stay attached to the box...
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.