问题
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