Remove previous mat-dialog's CSS from DOM

寵の児 提交于 2021-01-29 15:22:33

问题


I use two mat-dialog components in my application, and both have custom styles for cdk-global-overlay-wrapper. The problem here is, even after the first dialog is closed, its CSS still remains in scope, i.e., within the DOM. Hence, the style for cdk-global-overlay-wrapper from the second dialog gets overridden by the first one. Please suggest a possible solution.

component1.css

::ng-deep .cdk-global-overlay-wrapper {
    pointer-events: none !important;
}

component2.css

::ng-deep .cdk-global-overlay-wrapper {
    pointer-events: auto !important;
}

来源:https://stackoverflow.com/questions/65406048/remove-previous-mat-dialogs-css-from-dom

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!