我希望我的mat-autocomplete扩展它所在的对话框,而不是溢出。有什么办法可以实现?
这是我的代码:
<div class="label-modal">
<h1 mat-dialog-title>Add label</h1>
<div mat-dialog-content>
<form class="example-form">
<mat-form-field class="example-full-width">
<input type="text" matInput [matAutocomplete]="auto" [formControl]="myControl">
<mat-autocomplete #auto="matAutocomplete">
<mat-option (click)="onLabelClick(option)" *ngFor="let option of filteredOptions | async" [value]="option">
{{option}}
</mat-option>
</mat-autocomplete>
</mat-form-field>
</form>
<div id="selectedLabelBox">
<span *ngFor="let label of selectedLabels">{{label}}</span>
</div>
<h5 id="labelBoxTitle" class="modal-title">Popular labels</h5>
<div id="labelBox">
<span *ngFor="let label of popularLabels" (click)="onPopularLabelClick(label)">{{label}}</span>
</div>
</div>
</div>