Angular ngx daterangepicker z-index

Angular ngx daterangepicker z-index

我在扩展中有多个表单,我正在使用此代码作为日期选择器,

<mat-form-field>
  <input formControlName="date" matInput placeholder="Dátum" type="date">
</mat-form-field>

效果很好,扩展不会隐藏它 (have a look), but then I had start and end values for both date and time, so I switched to ngx material daterangepicker

我唯一的问题是扩展隐藏了 daterangepickers (have a look),因此 daterangepickers 代码如下所示:

      <mat-form-field>
        <input
          matInput
          ngxDaterangepickerMd
          name="daterange"
          placeholder="Choose date"
          applyLabel="Okay"
          startKey="start"
          endKey="end"
          firstMonthDayClass="first-day"
          lastMonthDayClass="last-day"
          emptyWeekRowClass="empty-week"
          lastDayOfPreviousMonthClass="last-previous-day"
          firstDayOfNextMonthClass="first-next-day"
          [autoApply]="options.autoApply"
          [linkedCalendars]="options.linkedCalendars"
          [singleDatePicker]="options.singleDatePicker"
          [showDropdowns]="true"
          formControlName="date"

          [showWeekNumbers]="options.showWeekNumbers"
          [showCancel]="options.showCancel"
          [showClearButton]="options.showClearButton"
          [showISOWeekNumbers]="options.showISOWeekNumbers"
          [customRangeDirection]="options.customRangeDirection"
          [lockStartDate]="options.lockStartDate"
          [closeOnAutoApply]="options.closeOnAutoApply"
          [opens]="opens"
          [drops]="drops"
          [timePicker]="timePicker"
        />
      </mat-form-field>

我试着给它一个自定义的 z-index,比如:

.md-drppicker {
  z-index: 9999;
}

ngx-daterangepicker-material {
  z-index: 9999;
}

但这并没有解决问题,我也试过 display/position,但我无法修复它。
知道出了什么问题吗?

编辑:Here's a better picture for the daterange picker problem

您需要使用 overflow 属性,因为日历没有 space。我认为它会解决您的问题。

.md-drppicker {
  z-index: 9999;
  overflow: auto; // also try overflow-y;
}

ngx-daterangepicker-material {
  z-index: 9999;
  overflow: auto; // also try overflow-y;
}

如果问题仍然存在,我建议您附加一个 stackblitz 实例。

我在 Angular 6.1.10

上使用 ngx-daterangepicker-material 2.4.1 版本

我们的问题是使用 MatInput 和 angular-split-ng6。

我们实施的 css 修复如下

.md-drppicker.drops-down-right.ltr.shown.double.show-ranges {
    position: fixed;
}

使用上面的方法后,我们的日历在相邻层上正确呈现,并且当启动日历的区域小于并排显示日历所需的宽度时,日历没有换行。