Skip to content

Commit

Permalink
[故障] 连续弹出多个消息框时位置计算错误
Browse files Browse the repository at this point in the history
  • Loading branch information
hpyou authored Jun 30, 2020
1 parent d0f8c9b commit 08da1c6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/jigsaw/pc-components/notification/notification.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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个方向。
Expand Down Expand Up @@ -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(() => {
Expand Down

0 comments on commit 08da1c6

Please sign in to comment.