Angular Material(2.0)自动完成建议面板出现在Bootstrap模态框后面。

3
我正在尝试为一个 bootstrap 模态框添加自动完成字段,但是当输入时,建议框会出现在模态框的背后,使用户无法看到。
我已经尝试了以下方法:
.mat-autocomplete-panel {
    position: fixed !important;
    z-index:100000 !important;
}

但我没有找到任何成功的方法,有人把建议框移到前面成功了吗?
图片:

enter image description here

1个回答

9
将以下代码粘贴到您的主要 style.scss 文件中:

/* 在模态框上使用 Mat Autocomplete 时的修复 */ .cdk-overlay-container {z-index: 999999 !important;}


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接