Skip to content

Commit b7054e3

Browse files
committed
fix(popup): Stopped attaching component to application repeatedly
Closes #178
1 parent b1c4aee commit b7054e3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/modules/popup/classes/popup-controller.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,11 @@ export abstract class SuiPopupController implements IPopup, OnDestroy {
5858
});
5959
}
6060

61-
// Move the generated element to the body to avoid any positioning issues.
61+
// Detach & reattach the generated component to the current application.
62+
this._componentFactory.detachFromApplication(this._componentRef);
6263
this._componentFactory.attachToApplication(this._componentRef);
64+
65+
// Move the generated element to the body to avoid any positioning issues.
6366
this._componentFactory.moveToDocumentBody(this._componentRef);
6467

6568
// Attach a reference to the anchor element. We do it here because IE11 loves to complain.

0 commit comments

Comments
 (0)