Skip to content

bug(Stepper): Cdk Stepper selected property setter method issue #28345

@kiran-cm

Description

@kiran-cm

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

Cdk Stepper selected property setter method indexOf not setting correct index.

this.selectedIndex = step && this.steps ? this.steps.toArray().indexOf(step) : -1;

Reproduction

Steps to reproduce:

  1. Create stepper using Cdk stepper guide
  2. Add onClick on cdkStep
  3. In onClick callback, set this.selected = this.steps.get(index);
  4. selectedIndex property of CdkStepper class not working properly.

Expected Behavior

selectedIndex property should be set properly correctly when we set selected from wrapper component.

Actual Behavior

selectedIndex set to -1

Environment

  • Angular: v16
  • CDK/Material: v16
  • Browser(s): NA
  • Operating System (e.g. Windows, macOS, Ubuntu): NA

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs triageThis issue needs to be triaged by the team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions