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

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

Closed
actra-gschuster opened this issue Nov 12, 2017 · 3 comments
Assignees

Comments

@actra-gschuster
Copy link
Contributor

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.

@actra-gschuster
Copy link
Contributor Author

Tracked it in the code, fix is simple, see PR #8398

actra-gschuster added a commit to actra-development-oss/angular-material2 that referenced this issue Nov 15, 2017
Now uses "emit on destroy" pattern for stepper to subscribe to step changes (fixes angular#8397)
jelbourn pushed a commit to actra-development-oss/angular-material2 that referenced this issue Nov 18, 2017
Now uses "emit on destroy" pattern for stepper to subscribe to step changes (fixes angular#8397)
jelbourn pushed a commit that referenced this issue Nov 18, 2017
Now uses "emit on destroy" pattern for stepper to subscribe to step changes (fixes #8397)
@mmalerba
Copy link
Contributor

fix has been merged

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants