Open
Description
Reproduction
Use StackBlitz to reproduce your issue: https://stackblitz.com/edit/angular-cdafd9?file=app%2Fstepper-overview-example.ts
Steps to reproduce:
- Create a mat-stepper component that renders mat-step elements from an array
- Pass in the selected index from the component (initially set to 0)
- Add a new element to the steps array for a dynamically added step and set the selected index to the new step index
Expected Behavior
Would expect to navigate to the new step component that was just added and for the stepper header to update
Actual Behavior
The new step gets added as expected, but the updating of the selected index leads to an exception Error: cdkStepper: Cannot assign out-of-bounds value to selectedIndex
- although the assigned index matches the last element in the array used to render the steps
Environment
- Angular: 8.2.6
- CDK/Material: 8.1.4
- Browser(s): Chrome 77
- Operating System (e.g. Windows, macOS, Ubuntu): macOS