components icon indicating copy to clipboard operation
components copied to clipboard

Select should adjust height when font-size changes

Open kara opened this issue 9 years ago • 10 comments

Currently when you change the font size of the select to override the default font size, the placeholder doesn't adjust to make space for a larger font. Md-input does do this, so select should as well.

kara avatar Dec 09 '16 03:12 kara

Just for reference Kara, I put a md-select after a md-input, and it overlaps without changing the font size.

<div>
      <md-input-container>
        <input md-input type="text" name="name" placeholder="Full name" formControlName="name">
      </md-input-container>
    </div>
    <div>
      <md-select placeholder="Company Name" formControlName="company">
        <md-option *ngFor="let company of companies" [value]="company.value">{{ company.viewValue}}</md-option>
      </md-select>
    </div>

renevall avatar Jan 25 '17 22:01 renevall

I had the same issue. I was able to workaround it by applying the following style (which basically remove the hard-coded values)

:host /deep/ .mat-select-trigger {
    font-size: inherit;
    height: inherit;
}

:host /deep/ .mat-select-value-text {
    line-height: inherit;
}

savatware avatar Feb 24 '17 12:02 savatware

@p-jan work around partly worked for me. I only needed the

:host /deep/ .mat-select-trigger {
    font-size: inherit;
}

And I added

.mat-select {
    padding-top: 5px;  //makes the select's baseline align with neighboring text input
    margin-bottom: 14px //makes the text input below my select align with it's neighbor also
}

hblieb avatar Apr 03 '17 20:04 hblieb

Any news on this? This issue still seems to exist in the latest version...

javagaba avatar Aug 03 '17 16:08 javagaba

I've fixed the alignment issue with this code:

.mat-select {
  margin-top: 14px;
}

You have to play with the margin-top value in your context. But that will align the input field and select field correctly with each other.

makdeniss avatar Aug 14 '17 08:08 makdeniss

Still no fix for this?

richmwatts avatar Aug 23 '17 10:08 richmwatts

Please fix this issue! Also the space between label and selected option is not the same than between label and text of an input field if you change the font-size.

qstiegler avatar Sep 18 '17 13:09 qstiegler

AFAIK this will be fixed by https://github.com/angular/material2/pull/6488

willshowell avatar Sep 18 '17 13:09 willshowell

Should be resolved with the existence of mat-form-field

jelbourn avatar May 09 '18 21:05 jelbourn

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.