Skip to content

bug(mat-stepper): Binding selectedIndex messes up interacted state #30540

@urugator

Description

@urugator

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

When slectedIndex input is bound and user navigates to a step, the step is immediately flagged as interacted.

Reproduction

StackBlitz link: https://stackblitz.com/edit/components-issue-starter-8hiddnw8?file=src%2Fmain.ts
Steps to reproduce:

  1. Click at step2, notice the "interacted" event was emitted for step2, which also caused the field showing errored state, even though the user did not interacted with step2 yet.
  2. Remove [selectedIndex]="selectedIndex()" from <mat-stepper> and repeat the above - everything works as expected.

Expected Behavior

Binding selectedIndex has no effect on interacted behavior.

Actual Behavior

Binding selectedIndex changes interacted behavior.

Environment

  • Angular: 18.2.13
  • CDK/Material: 18.2.14
  • Browser(s): *
  • Operating System (e.g. Windows, macOS, Ubuntu): *

Metadata

Metadata

Assignees

Labels

P2The issue is important to a large percentage of users, with a workaroundarea: material/stepper

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions