Skip to content

Commit

Permalink
fix(module:nz-alert): emit close after fade animation is done
Browse files Browse the repository at this point in the history
  • Loading branch information
dmytroyarmak committed Jun 15, 2018
1 parent fc67ce5 commit 263f012
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion components/alert/nz-alert.component.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div [ngClass]="outerClassMap" *ngIf="display" [@fadeAnimation]>
<div [ngClass]="outerClassMap" *ngIf="display" [@fadeAnimation] (@fadeAnimation.done)="onFadeAnimationDone()">
<ng-container *ngIf="nzShowIcon">
<i class="ant-alert-icon" [ngClass]="nzIconType" *ngIf="nzIconType; else iconTemplate"></i>
<ng-template #iconTemplate>
Expand Down
7 changes: 6 additions & 1 deletion components/alert/nz-alert.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,12 @@ export class NzAlertComponent implements OnInit {

closeAlert(): void {
this.display = false;
this.nzOnClose.emit(true);
}

onFadeAnimationDone(): void {
if (!this.display) {
this.nzOnClose.emit(true);
}
}

updateOuterClassMap(): void {
Expand Down

0 comments on commit 263f012

Please sign in to comment.