Skip to content

Commit

Permalink
feat(kit): safety change active index in stepper (#10004)
Browse files Browse the repository at this point in the history
  • Loading branch information
splincode authored Dec 17, 2024
1 parent 9327709 commit 286b6d2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions projects/kit/components/stepper/stepper.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,10 @@ export class TuiStepperComponent {

@Input('activeItemIndex')
public set activeIndex(index: number) {
this.activeItemIndex = index;
this.scrollIntoView(index);
if (this.steps.get(index)?.nativeElement) {
this.activeItemIndex = index;
this.scrollIntoView(index);
}
}

public indexOf(step: HTMLElement): number {
Expand Down

0 comments on commit 286b6d2

Please sign in to comment.