From 08da1c6c79b1ada3ae7d7884d7138f72ab567ec1 Mon Sep 17 00:00:00 2001 From: You Haipeng Date: Tue, 30 Jun 2020 16:14:45 +0800 Subject: [PATCH] =?UTF-8?q?[=E6=95=85=E9=9A=9C]=20=E8=BF=9E=E7=BB=AD?= =?UTF-8?q?=E5=BC=B9=E5=87=BA=E5=A4=9A=E4=B8=AA=E6=B6=88=E6=81=AF=E6=A1=86?= =?UTF-8?q?=E6=97=B6=E4=BD=8D=E7=BD=AE=E8=AE=A1=E7=AE=97=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/jigsaw/pc-components/notification/notification.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/jigsaw/pc-components/notification/notification.ts b/src/jigsaw/pc-components/notification/notification.ts index beac92f572..972fdd2ab5 100644 --- a/src/jigsaw/pc-components/notification/notification.ts +++ b/src/jigsaw/pc-components/notification/notification.ts @@ -15,6 +15,7 @@ import {JigsawTrustedHtmlModule} from "../../common/directive/trusted-html/trust import {CommonUtils} from "../../common/core/utils/common-utils"; import {JigsawButtonModule} from "../button/button"; import {InternalUtils} from "../../common/core/utils/internal-utils"; +import {take} from 'rxjs/operators'; /** * 提示框所处的位置,目前支持左上、左下、右上、右下4个方向。 @@ -420,7 +421,10 @@ export class JigsawNotification extends AbstractDialogComponentBase { popupInfo.instance._popupInfo = popupInfo; notificationInstances[NotificationPosition[opt.position]].push(popupInfo); - Promise.resolve().then(() => this.reposition(opt.position)); + let onStableSubscription = InternalUtils.zone.onStable.asObservable().pipe(take(1)).subscribe(() => { + onStableSubscription.unsubscribe(); + this.reposition(opt.position); + }); if (!this._removeResizeListener) { InternalUtils.zone.runOutsideAngular(() => {