0
votes

I think this is simple for many of you, but I am unable to figure it out.

I am using mat-select inside a form, when I want to select the option from the list, the options width is getting into 100%. But It should be upto the select box.

Here is the snapshot of the options width,

enter image description here

and here is the HTML,

<mat-form-field class="form" appearance="outline">
          <mat-select formControlName="paymentType" placeholder="Type" (selectionChange)="onChange($event)">
            <mat-option *ngFor="let payment of paymentTypes" [value]="payment.value">
              {{payment.viewValue}}
            </mat-option>
          </mat-select>
        </mat-form-field>

I want the width of option to just appear below the select box.

Please help me.

1
Please provide a demoVega

1 Answers

0
votes

I think adding a "max-width" style directly to the mat-option node will be enough to fix your problem.