如何更改垫子 select 中下拉菜单的方向?
How to change the direction of a dropdown in a mat select?
我正在使用垫子 select 来显示项目列表。
<mat-label>{{ 'CLAIMS.PLACEHOLDERS.STATUS' | translate }}</mat-label>
<mat-select (valueChange)="onStatusChange($event)">
<mat-option *ngFor="let option of statusses" [value]="option">
{{ 'STATUS.' + option | translate }}
</mat-option>
</mat-select>
当 select 使用某些选项时,我的下拉菜单“卡在”我的导航栏中:
有什么方法可以改变下拉菜单的“方向”吗?所以它向下而不是向上?
我可以通过添加 disableOptionCentering 选项强制我的下拉菜单向下打开。
<mat-label>{{ 'CLAIMS.PLACEHOLDERS.CLAIMTYPE' | translate }}</mat-label>
<mat-select (valueChange)="onClaimTypeChange($event)" disableOptionCentering>
<mat-option *ngFor="let option of claimTypes" [value]="option">
{{ option }}
</mat-option>
</mat-select>
我正在使用垫子 select 来显示项目列表。
<mat-label>{{ 'CLAIMS.PLACEHOLDERS.STATUS' | translate }}</mat-label>
<mat-select (valueChange)="onStatusChange($event)">
<mat-option *ngFor="let option of statusses" [value]="option">
{{ 'STATUS.' + option | translate }}
</mat-option>
</mat-select>
当 select 使用某些选项时,我的下拉菜单“卡在”我的导航栏中:
有什么方法可以改变下拉菜单的“方向”吗?所以它向下而不是向上?
我可以通过添加 disableOptionCentering 选项强制我的下拉菜单向下打开。
<mat-label>{{ 'CLAIMS.PLACEHOLDERS.CLAIMTYPE' | translate }}</mat-label>
<mat-select (valueChange)="onClaimTypeChange($event)" disableOptionCentering>
<mat-option *ngFor="let option of claimTypes" [value]="option">
{{ option }}
</mat-option>
</mat-select>