Skip to content

Commit

Permalink
fix: Fixed tests failing after commit for #14
Browse files Browse the repository at this point in the history
  • Loading branch information
trickeyone committed Oct 30, 2019
1 parent 83f28ca commit 8c30211
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/toggle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export class NgToggle implements AfterViewInit, AfterContentInit, AfterViewCheck
ngAfterViewInit(): void {
this.calculateWidth();
this._initialized = true;
setTimeout(() => this._disableInitialAnimation = false);
this.ngZone.run(() => setTimeout(() => this._disableInitialAnimation = false));
}

ngAfterViewChecked(): void {
Expand Down Expand Up @@ -209,7 +209,7 @@ export class NgToggle implements AfterViewInit, AfterContentInit, AfterViewCheck

@HostBinding('class.ng-toggle-animate')
get animate(): boolean {
return this._animate && (this._initialized && !this._disableInitialAnimation);
return this._animate && (!this._disableInitialAnimation || this._initialized && !this._disableInitialAnimation);
}

get marginLeft(): string {
Expand Down

0 comments on commit 8c30211

Please sign in to comment.