Prefilled form for linear stepper doesn't allow one to click on all steps
See original GitHub issueBug, feature request, or proposal:
Feature request
What is the expected behavior?
A linear stepper whose associated form is populated using patchValue
or setValue
and is valid should allow you to click on any of the steps right away.
What is the current behavior?
I have to keep pressing the “next” button as I am restricted to clicking on steps I have visited and the one immediately after.
What are the steps to reproduce?
- Create a linear stepper with > 3 steps
- Associate the stepper with a form and each step with a form group
- Programmatically patch the value of the form groups associated with the steps to a valid state
- Not all steps on the stepper are clickable even though the form and the groups are valid
What is the use-case or motivation for changing an existing behavior?
Saving the user’s progress for a long form and returning them to the step they left off on.
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
I’m on Angular 5.2.3, Angular Material 5.2, MacOS, TS 2.4.2.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:7
- Comments:9 (1 by maintainers)
Top Results From Across the Web
Angular Material Stepper component prevent going to all the ...
The solution that I found to this problem is to use completed attribute of step. Refer to the line of code given below:....
Read more >Stepper | Angular Material
Angular Material's stepper provides a wizard-like workflow by dividing content into logical steps. Material stepper builds on the foundation of the CDK ...
Read more >Angular Material Stepper - GeeksforGeeks
The Stepper Component in the Angular material allows the user to create a wizard-like a workflow by dividing the content into logical steps....
Read more >Automatic HVAC Air Recirculation Made Easy with Stepper ...
by customer's technical experts. onsemi does not convey any license under any of its ... valve controlled by a linear stepper-motor has previously....
Read more >Materialize Stepper - GitHub Pages
Linear Stepper is the most common one. In it, you can't navigate freely between steps. It's step by step, obeying the validation function....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Also having this problem in Angular 6.0.1, Material 6.0.2, TS 2.7.2. It was working as @MrSnappingTurtle and I expected in version 2.0.0-beta.12 however.
This issue makes the stepper only usable in “create” mode and not “edit” mode. Which is to say it’s not very usable as a UI component at all when [linear]=“true”. We’re making the move to upgrade to 6.0, but this issue is making me have to rethink our whole UX around our forms.
Is there anything I can do to help get this fixed?
A temporary workaround for this might be like this:
HTML:
TypeScript:
Note 1: You might decide to check for the validity of each step before u set the stepper as interacted(completely fail safe)
Note 2 : Using completed instead of interacted also works.