diff --git a/projects/kit/components/stepper/stepper.component.ts b/projects/kit/components/stepper/stepper.component.ts index 86145262725f..ba02b2df1a3b 100644 --- a/projects/kit/components/stepper/stepper.component.ts +++ b/projects/kit/components/stepper/stepper.component.ts @@ -98,9 +98,11 @@ export class TuiStepperComponent { } indexOf(step: HTMLElement): number { - return tuiGetOriginalArrayFromQueryList(this.steps).findIndex( + const index = tuiGetOriginalArrayFromQueryList(this.steps).findIndex( ({nativeElement}) => nativeElement === step, ); + + return index < 0 ? NaN : index; } isActive(index: number): boolean {