angular2-mdl icon indicating copy to clipboard operation
angular2-mdl copied to clipboard

Mdl dialog create 2 mdl-backdrop-overlay's

Open maximelkin opened this issue 5 years ago • 2 comments

This leads to bug with closing dialog (page is still clickable and blurred)

maximelkin avatar Apr 11 '19 12:04 maximelkin

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

maximelkin avatar Apr 11 '19 13:04 maximelkin

Temporary workaround

const initial = (MdlDialogOutletService.prototype as any).setViewContainerRef;
(MdlDialogOutletService.prototype as any).setViewContainerRef = function(...args) {
    if (!this.backdropComponent) {
        initial.apply(this, args);
    }
};

maximelkin avatar Apr 11 '19 13:04 maximelkin