Reputation: 1972
I am having a material dialog, in that dialog I've a stepper.. I've 4 steps.. where each step consists a form..
When I submit first step, I'm saving the form and moving to next step..
Here if I close my dialog and again if I try to open it again.. I want my stepper to start from step2. I don't want to go back to step 1 as it's submitted and step1 should be in completed state.
Here I've tried different scenearios most of the times I'm not getting form in the step2..
Can anyone please share any scenarios or solutions to achieve this..
Upvotes: 0
Views: 1150
Reputation: 1
The solution is simple, you need to save the form data, when you close a form save the data inside an array. Next time you open the form you need to pass that array to the dialog component.
The first thing you need to perform is to patch the value of from. For example, if the length of the array is 1 then patch the index 0 objects value to form 1.
And to skip the step you can use the array's length. For example, length is one then your step will be 2. So you can simply set the step value.
Upvotes: 0