我有一个包含使用角材料的垫选择组件的下拉列表的表单。<mat-select multiple (selectionChange)="onFilter($event)"> <mat-option *ngFor="let section of someDropdown" [value]="section"> {{section}} </mat-option></mat-select><button class="some-button" (click)="doSomething()>Click Me</button>打开下拉菜单后,我无法单击其外部的任何元素(即按钮)。我首先需要单击下拉列表的外部以将其关闭,然后才能与其他控件进行交互。有没有一种方法可以禁用此组件的模糊效果(因此在下拉列表打开时我可以单击一个按钮)?
2 回答

莫回无
TA贡献1865条经验 获得超7个赞
我发现解决此问题的最佳方法是将所需控件的z-index设置为高于默认的材质背景覆盖(z-index:1000);
<button class="some-button" (click)="doSomething()>Click Me</button>
CSS:
.some-button {
z-index: 1001 //set this higher than the overlay backgrop
}
添加回答
举报
0/150
提交
取消