Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
1 task
urugator opened this issue Feb 24, 2025 · 0 comments · Fixed by #30579
Closed
1 task

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

urugator opened this issue Feb 24, 2025 · 0 comments · Fixed by #30579
Assignees
Labels
area: material/stepper P2 The issue is important to a large percentage of users, with a workaround

Comments

@urugator
Copy link

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): *
@urugator urugator added the needs triage This issue needs to be triaged by the team label Feb 24, 2025
@wagnermaciel wagnermaciel added P2 The issue is important to a large percentage of users, with a workaround area: material/stepper and removed needs triage This issue needs to be triaged by the team labels Feb 24, 2025
@crisbeto crisbeto self-assigned this Mar 4, 2025
crisbeto added a commit to crisbeto/material2 that referenced this issue Mar 4, 2025
Fixes that the stepper was marking an item as interacted and emitting an event whenever the `selectedIndex` is assigned, even if it's the same.

Fixes angular#30540.
crisbeto added a commit that referenced this issue Mar 4, 2025
…#30579)

Fixes that the stepper was marking an item as interacted and emitting an event whenever the `selectedIndex` is assigned, even if it's the same.

Fixes #30540.
crisbeto added a commit that referenced this issue Mar 4, 2025
…#30579)

Fixes that the stepper was marking an item as interacted and emitting an event whenever the `selectedIndex` is assigned, even if it's the same.

Fixes #30540.

(cherry picked from commit 4f3c931)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: material/stepper P2 The issue is important to a large percentage of users, with a workaround
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants