From b4e7df41e0c55bf181eb05ecc4379c445dab0c8c Mon Sep 17 00:00:00 2001 From: Vagner Sabadi Date: Thu, 27 May 2021 17:25:05 -0300 Subject: [PATCH] fix(stepper): add detectChanges --- projects/core/src/lib/stepper/stepper.component.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/projects/core/src/lib/stepper/stepper.component.ts b/projects/core/src/lib/stepper/stepper.component.ts index 6df3b0d7..cac4ccc8 100644 --- a/projects/core/src/lib/stepper/stepper.component.ts +++ b/projects/core/src/lib/stepper/stepper.component.ts @@ -8,7 +8,9 @@ import { QueryList, Input, ViewChild, - Output + Output, + ChangeDetectorRef, + AfterViewInit } from '@angular/core'; import { FivStepContent } from './step-content/step-content.component'; import { FivStepperHorizontal } from './stepper-horizontal/stepper-horizontal.component'; @@ -18,7 +20,7 @@ import { FivStepperHorizontal } from './stepper-horizontal/stepper-horizontal.co templateUrl: './stepper.component.html', styleUrls: ['./stepper.component.scss'] }) -export class FivStepper implements OnInit { +export class FivStepper implements OnInit, AfterViewInit { @ContentChildren(FivStep) contents: QueryList; @ViewChildren(FivStepContent) steps: QueryList; @ViewChild(FivStepperHorizontal, { static: false }) @@ -31,10 +33,14 @@ export class FivStepper implements OnInit { param: any; - constructor() {} + constructor(private change: ChangeDetectorRef) {} ngOnInit() {} + ngAfterViewInit(): void { + this.change.detectChanges(); + } + open(index: number) { if (this.mode === 'horizontal') { this.currentIndex = index;