From b09a615fa94177d9546568d1208c5f3094ace579 Mon Sep 17 00:00:00 2001 From: Ed Carroll Date: Fri, 11 Aug 2017 01:29:32 +0100 Subject: [PATCH 1/2] fix(popup): Fixed conflict with BrowserAnimationsModule Closes #204 --- src/modules/popup/classes/popup-controller.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/modules/popup/classes/popup-controller.ts b/src/modules/popup/classes/popup-controller.ts index 641061b02..d9655f1fc 100644 --- a/src/modules/popup/classes/popup-controller.ts +++ b/src/modules/popup/classes/popup-controller.ts @@ -65,8 +65,7 @@ export abstract class SuiPopupController implements IPopup, OnDestroy { }); } - // Detach & reattach the generated component to the current application. - this._componentFactory.detachFromApplication(this._componentRef); + // Attach the generated component to the current application. this._componentFactory.attachToApplication(this._componentRef); // Move the generated element to the body to avoid any positioning issues. @@ -151,7 +150,6 @@ export abstract class SuiPopupController implements IPopup, OnDestroy { } } - // @HostListener("document:click", ["$event"]) public onDocumentClick(e:MouseEvent):void { // If the popup trigger is outside click, if (this._componentRef && this.popup.config.trigger === PopupTrigger.OutsideClick) { @@ -178,6 +176,7 @@ export abstract class SuiPopupController implements IPopup, OnDestroy { } public ngOnDestroy():void { + this._componentFactory.detachFromApplication(this._componentRef); this._componentRef.destroy(); } } From f6b390357195e23f2f8b146bc67637b63e3d79c1 Mon Sep 17 00:00:00 2001 From: Edward Carroll Date: Fri, 11 Aug 2017 18:11:51 +0100 Subject: [PATCH 2/2] style(popup): Fixed tslint error --- src/modules/popup/classes/popup-controller.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/popup/classes/popup-controller.ts b/src/modules/popup/classes/popup-controller.ts index 0686b614d..43533c92e 100644 --- a/src/modules/popup/classes/popup-controller.ts +++ b/src/modules/popup/classes/popup-controller.ts @@ -176,7 +176,7 @@ export abstract class SuiPopupController implements IPopup, OnDestroy { } public ngOnDestroy():void { - clearTimeout(this._openingTimeout); + clearTimeout(this._openingTimeout); this._componentFactory.detachFromApplication(this._componentRef); this._componentRef.destroy(); }