zaguiini / formik-wizard

A multi-step form component powered by formik and react-albus
MIT License
86 stars 26 forks source link

Jump to Previous Steps #21

Closed nishojib closed 4 years ago

nishojib commented 4 years ago

Currently, the scenario I have is like this. Say I have 4 steps: A, B, C, and D And 4 buttons namely, Step A, Step B, Step C, and Step D.

I have completed till step B and currently, I am at step C but I want to be able to jump to the previous steps with the click of the step buttons (can be either Step A or Step B). But if I want to jump to step D I will be stopped and moved to the uncompleted step C.

I have looked into the push method from the wizard props in the FormWrapper but the push method puts me in any step I click.

Is there a way to do this?

Here is a codesandbox of the problem.

zaguiini commented 4 years ago

You can do that using the wizard prop exposed on the FormWrapper component. Closing as this is not a problem with the library itself.