Mat-datepicker-toggle显示在模式后面,而不是在此位置

时间:2019-01-04 20:20:56

标签: angular bootstrap-4

Helloo,在使用角度7和自举4时,我的视图出现问题。单击“打开”以显示日历时。它显示在我的模态后面,并显示在左侧。我该如何解决问题?

problem

code

3 个答案:

答案 0 :(得分:0)

 <div class="modal-body">

      <mat-form-field>
        <input matInput [matDatepicker]="myDatepicker">
        <mat-datepicker-toggle matSuffix [for]="myDatepicker"></mat-datepicker-toggle>
        <mat-datepicker #myDatepicker></mat-datepicker>
      </mat-form-field>

答案 1 :(得分:0)

<mat-form-field>
     <input formControlName="dateFrom
     Selector" matInput
                      [matDatepicker]="pickerDateFromSelector" placeholder="Please Select Date">
                    <mat-datepicker-toggle matSuffix [for]="pickerDateFromSelector"></mat-datepicker-toggle>
                    <mat-datepicker #pickerDateFromSelector></mat-datepicker>
                    </mat-form-field>

Selector"></mat-datepicker-toggle>
   <mat-datepicker #pickerDateSelector></mat-datepicker>
</mat-form-field>

答案 2 :(得分:0)

将其添加到CSS对我有用。我正在使用Angular 8和Angular Material 8.2.3

.cdk-overlay-container{
  z-index: 2000;
}