Skip to content

Stepper: Removing step does not reflect to header until clicked, then errors due to index = -1 #8397

@actra-gschuster

Description

@actra-gschuster

Bug, feature request, or proposal:

Bug report

What is the expected behavior?

When removing a step, e.g. by an *ngIf on the <mat-step>, the change should be reflected in the header (step not shown anymore).
Dynamically adding the step seems to work without issues.

What is the current behavior?

Step still shows in header until I try to click on it, then it errors because CDKs doesn't check for invalid steps:
set selected(): this.selectedIndex = this._steps.toArray().indexOf(step);
The root cause of the problem is the change in the ContentChildren() not being reflected properly.

What is the use-case or motivation for changing an existing behavior?

Add / remove steps dynamically based on user inputs

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

ng 5.1.0-beta.0, material and cdk latest builds from today, typescript 2.6.1.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions