Skip to content

*ngIf on a mat-step breaks the stepper if the expression becomes false from a later step #11791

Closed
@adamdport

Description

@adamdport

Bug, feature request, or proposal:

bug

What is the expected behavior?

I can remove a step at any time without the stepper crashing

What is the current behavior?

If an earlier step is removed while a later step is active, the current step disappears. If you manually click a still visible previous step, we get an error Error: Cannot set property 'interacted' of undefined

What are the steps to reproduce?

https://stackblitz.com/edit/angular-material2-issue-fm21qe

  1. toggling step 2 from step 1 works fine.
  2. toggling step 2 from step 3 breaks step 3
  3. after toggling from step 3, navigation to step 1 emits an error

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

We can remove later steps using *ngIf without issue, so one would presume they could remove a step at any time. If it's decided that removing a previous step doesn't make sense, this should at least fail gracefully.

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

6.2.0

Is there anything else we should know?

Metadata

Metadata

Assignees

Labels

P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions