简体   繁体   English

Angular 2 ng-bootstrap打开多个模型

[英]Angular 2 ng-bootstrap open multiple models

I am trying to open modal on top of another model using ng-bootstrap. 我正在尝试使用ng-bootstrap在另一个模型之上打开模式。 Model is open as expected but the modal-backdrop of the second model is behind the fist model. 该模型已按预期方式打开,但第二个模型的模态背景落后于第一个模型。 在此处输入图片说明

Models have opend as the document . 模型已作为文档打开。 Nothing special has done. 没什么特别的。

I managed to get this work as just by adding following css code. 我设法通过添加以下CSS代码来完成这项工作。

.modal:nth-of-type(2) {
    z-index: 1051 !important;
}
.modal-backdrop:nth-of-type(2) {
    z-index: 1050 !important;
}

.modal:nth-of-type(3) {
    z-index: 1052 !important;
}
.modal-backdrop:nth-of-type(3) {
    z-index: 1051 !important;
} 

I want to open 3 nested models. 我想打开3个嵌套模型。 That's why I added nth-of-type(2) and nth-of-type(3) 这就是为什么我添加了nth-of-type(2)和nth-of-type(3)

add this style to your code: 将此样式添加到您的代码中:

.modal {
    background: rgba(0,0,0,0.3);
}

and then disable modal-backdrop by setting the display to 'none' 然后通过将显示设置为“无”来禁用模式背景

OR 要么

set aria-hidden="false" in your template inside div that contain mdbModal property 在div中包含mdbModal属性的模板中设置aria-hidden =“ false”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM