diff --git a/src/directives/toggle/toggle.directive.ts b/src/directives/toggle/toggle.directive.ts index 5e6b8a70c23..949209bf24c 100644 --- a/src/directives/toggle/toggle.directive.ts +++ b/src/directives/toggle/toggle.directive.ts @@ -71,6 +71,9 @@ export class IgxToggleDirective implements IToggleView, OnInit, OnDestroy { if (!this.collapsed) { return; } const player = this.animationActivation(); + player.onStart(() => { + this.collapsed = false; + }); player.onDone(() => { player.destroy(); if (fireEvents) { @@ -78,7 +81,6 @@ export class IgxToggleDirective implements IToggleView, OnInit, OnDestroy { } }); - this.collapsed = !this.collapsed; if (fireEvents) { this.onOpening.emit(); } @@ -89,10 +91,8 @@ export class IgxToggleDirective implements IToggleView, OnInit, OnDestroy { if (this.collapsed) { return; } const player = this.animationActivation(); - player.onStart(() => { - }); player.onDone(() => { - this.collapsed = !this.collapsed; + this.collapsed = true; // When using directive into component with OnPush it is necessary to // trigger change detection again when close animation ends // due to late updated @collapsed property. diff --git a/src/drop-down/drop-down.component.html b/src/drop-down/drop-down.component.html index c2223a93539..bb33bc48788 100644 --- a/src/drop-down/drop-down.component.html +++ b/src/drop-down/drop-down.component.html @@ -1,5 +1,5 @@