angular material mat-select drop-down width

Discussão em 'Angular' iniciado por Meng, Outubro 8, 2024.

  1. Meng

    Meng Guest

    The current drop-down box has width greater than the the width of the line:
    [​IMG]

    Is there a way to get rid of the extra width?
    [​IMG]

    Here is my current code:

    html:

    <mat-form-field>
    <mat-select disableOptionCentering placeholder="Choose an option">
    <mat-option [value]="option" *ngFor="let option of my_list">
    {{ option }}
    </mat-option>
    </mat-select>
    </mat-form-field>



    my_list:

    export const my_list: string[] = [ "a", "b", "c", "d"];



    style.css:

    .mat-select-panel{
    margin-left: 15px;
    margin-top: 28px;
    }

    Continue reading...

Compartilhe esta Página