相关疑难解决方法(0)

如何减小 MatSelect DropDown 面板的大小

我正在尝试减小 mat-select 下拉面板的默认大小,但无法弄清楚如何去做

我试过给 width ,试过在 angular mat-select 中覆盖面板类,但尺寸似乎没有减小

我的模板文件

    <div class="col-md-8">
       <mat-form-field style="float: right">
          <mat-select panelclass="my-panel" placeholder="Select Course"(selectionChange)="selectCourse($event,courses)" disableOptionCentering>
         <mat-option *ngFor="let course of courses" [value]="course.courseId">
          {{course.courseCode}}
        </mat-option>
      </mat-select>
    </mat-form-field>
  </div>
Run Code Online (Sandbox Code Playgroud)

我的 CSS 文件

 .my-panel {
   background: orange;
   height: 300px;
   display: flex;
   flex-direction: column;
   justify-content: space-between;
   min-width: 350px !important;
   }
Run Code Online (Sandbox Code Playgroud)

预期结果 :
预期结果

实际结果 : 实际结果

新问题

angular-material angular angular-material-6

6
推荐指数
2
解决办法
9173
查看次数