Skip to content

Commit 08da1c6

Browse files
authored
[故障] 连续弹出多个消息框时位置计算错误
1 parent d0f8c9b commit 08da1c6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/jigsaw/pc-components/notification/notification.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import {JigsawTrustedHtmlModule} from "../../common/directive/trusted-html/trust
1515
import {CommonUtils} from "../../common/core/utils/common-utils";
1616
import {JigsawButtonModule} from "../button/button";
1717
import {InternalUtils} from "../../common/core/utils/internal-utils";
18+
import {take} from 'rxjs/operators';
1819

1920
/**
2021
* 提示框所处的位置,目前支持左上、左下、右上、右下4个方向。
@@ -420,7 +421,10 @@ export class JigsawNotification extends AbstractDialogComponentBase {
420421
popupInfo.instance._popupInfo = popupInfo;
421422
notificationInstances[NotificationPosition[opt.position]].push(popupInfo);
422423

423-
Promise.resolve().then(() => this.reposition(opt.position));
424+
let onStableSubscription = InternalUtils.zone.onStable.asObservable().pipe(take(1)).subscribe(() => {
425+
onStableSubscription.unsubscribe();
426+
this.reposition(opt.position);
427+
});
424428

425429
if (!this._removeResizeListener) {
426430
InternalUtils.zone.runOutsideAngular(() => {

0 commit comments

Comments
 (0)