相关疑难解决方法(0)

为什么mat-select不能在模态中工作?onclick它显示了Modal背后的选项

我使用了ngx-bootstrap模态.但是当我使用mat-select内部时,我遇到了问题.在模态后面的mat-select选项显示.我已经这些解决方案在这里的解决方案,并 同时这一个

这是我的代码

<ng-template style="border: 0px ;z-index: 100" #editTemplate>
  <mat-form-field>
                <mat-select multiple placeholder="Multiple Cities" [(ngModel)]="currentCity" name="Paris" ariaLabel="cities[0]">
                  <mat-option *ngFor="let city of cities" [value]="city.value">
                    {{ city.viewValue }}
                  </mat-option>
                </mat-select>
              </mat-form-field>
<ng-template>
Run Code Online (Sandbox Code Playgroud)

material-design angular2-template angular-material2 angular2-modal angular

10
推荐指数
4
解决办法
4428
查看次数

在模式对话框内显示垫选择

我正在显示 a mat-selectinside a ngx-smart-dialog,当我打开它时,select它显示在对话框后面。我用这个解决方案找到了这个这个:

.cdk-global-overlay-wrapper, .cdk-overlay-container {
    z-index: 9999!important;
}
Run Code Online (Sandbox Code Playgroud)

如果我将其放入全局文件中,问题就解决了.scss。我想知道的是(因为在我读到的内容中我没有找到解释)为什么将它放在组件的视图(即模态组件的视图)中它不起作用。

提前致谢!

angular-material angular

1
推荐指数
1
解决办法
6713
查看次数