【发布时间】:2020-07-31 02:24:12
【问题描述】:
我在扩展中有多个表单,并且我使用此代码作为日期选择器,
<mat-form-field>
<input formControlName="date" matInput placeholder="Dátum" type="date">
</mat-form-field>
效果很好,扩展并没有隐藏它(have a look),但是我有日期和时间的开始和结束值,所以我切换到 ngx material daterangepicker。
我唯一的问题是扩展隐藏了 daterangepicker (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;
}
但这并没有解决问题,也尝试弄乱显示/位置,但我无法修复它。
知道有什么问题吗?
【问题讨论】:
-
你有没有找到一个解决方案,让它以更高的 z-index 显示,这样它就不会隐藏在滚动区域中?我在我们的应用程序中处理相同类型的问题。我们尝试使用 Renderer2 以将其提升到更高的水平,这适用于显示,但随后它破坏了所有预期的用户点击功能。这意味着用户在日历上的每一次点击都会导致日历关闭。感谢您的任何意见。
标签: css angular z-index date-range ngx-daterangepicker-material