sgr*_*lon 5 angular-material angular
我ngx-timepicker-field
的在MatDialog
。当我的时间选择器显示时,他在MatDialog
模态弹出窗口的后面。
constructor(public dialog: MatDialog) { }
const dialogRef = this.dialog.open(PopupComponent, {
data: {
...
},
position: {
top: '50px'
}
});
Run Code Online (Sandbox Code Playgroud)
弹出组件:
@ViewChild('sendAlertHour', {static: false} ) sendAlertHour: NgxTimepickerFieldComponent;
<div>
<ngx-timepicker-field #sendAlertHour></ngx-timepicker-field>
</div>
Run Code Online (Sandbox Code Playgroud)
小智 10
在全局样式表 (styles.scss) 中添加以下内容:
.timepicker-overlay {
z-index: 1100 !important;
}
.timepicker-backdrop-overlay {
z-index: 1100 !important;
}
Run Code Online (Sandbox Code Playgroud)
这将在材质对话框上方显示时间选择器。解决方案在这里找到。
我找到了一个解决方法。我改变z-index
了MatDialog
我将其添加到我的 Angular 应用程序的全局 CSS 文件中:
.cdk-overlay-container {
z-index: 500 !important;
}
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
2665 次 |
最近记录: |