angular2-mdl
angular2-mdl copied to clipboard
Mdl dialog create 2 mdl-backdrop-overlay's
This leads to bug with closing dialog (page is still clickable and blurred)
This bug reproducing on dialog-outlet placed inside app-root MdlDialogInnerOutletComponent constructor -> setDefaultViewContainerRef -> setViewContainerRef -> created MdlBackdropOverlayComponent
And
MdlDialogOutletService constructor -> ngZone.onStable.pipe subscribe -> setViewContainerRef -> created MdlBackdropOverlayComponent
So this 2 flows creates 2 MdlBackdropOverlayComponent
Temporary workaround
const initial = (MdlDialogOutletService.prototype as any).setViewContainerRef;
(MdlDialogOutletService.prototype as any).setViewContainerRef = function(...args) {
if (!this.backdropComponent) {
initial.apply(this, args);
}
};