diff --git a/src/app/components/toast/toast.ts b/src/app/components/toast/toast.ts index 727c5988aa7..f0051f493bc 100755 --- a/src/app/components/toast/toast.ts +++ b/src/app/components/toast/toast.ts @@ -4,7 +4,7 @@ import {Message, PrimeNGConfig} from 'primeng/api'; import {DomHandler} from 'primeng/dom'; import {PrimeTemplate,SharedModule} from 'primeng/api'; import {MessageService} from 'primeng/api'; -import {UniqueComponentId} from 'primeng/utils'; +import {ObjectUtils, UniqueComponentId} from 'primeng/utils'; import {RippleModule} from 'primeng/ripple'; import {Subscription} from 'rxjs'; import {trigger,state,style,transition,animate,query,animateChild,AnimationEvent} from '@angular/animations'; @@ -305,7 +305,7 @@ export class Toast implements OnInit,AfterContentInit,OnDestroy { onAnimationEnd(event: AnimationEvent) { if (event.toState === 'void') { - if (this.autoZIndex && !this.messages.length ) { + if (this.autoZIndex && ObjectUtils.isEmpty(this.messages)) { ZIndexUtils.clear(this.containerViewChild.nativeElement); } }