mat-autocomplete应该展开MatDialog

时间:2018-10-23 07:34:00

标签: angular angular-material angular6

enter image description here

我希望我的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>

0 个答案:

没有答案
相关问题