Skip to content

Select should adjust height when font-size changes #2127

Closed

Description

@kara

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.

Activity

  1. self-assigned this
    on Dec 9, 2016
  2. added
    P3
    on Dec 9, 2016
  3. renevall commented on Jan 25, 2017

    @renevall

    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>
  4. savatware commented on Feb 24, 2017

    @savatware

    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;
    }
    
  5. assigned and unassigned on Mar 1, 2017
  6. hblieb commented on Apr 3, 2017

    @hblieb

    @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
    }
    
  7. javagaba commented on Aug 3, 2017

    @javagaba

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

  8. makdeniss commented on Aug 14, 2017

    @makdeniss

    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.

  9. richmwatts commented on Aug 23, 2017

    @richmwatts

    Still no fix for this?

  10. qstiegler commented on Sep 18, 2017

    @qstiegler

    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.

  11. willshowell commented on Sep 18, 2017

    @willshowell
    Contributor

    AFAIK this will be fixed by #6488

  12. jelbourn commented on May 9, 2018

    @jelbourn
    Contributor

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

  13. angular-automatic-lock-bot commented on Sep 8, 2019

    @angular-automatic-lock-bot

    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.

  14. locked and limited conversation to collaborators on Sep 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions