How to skip Wizard step conditionally?
I have Wizard with steps. I want to skip the step conditionally. For example, skip step if uploaded file is not CSV, I can add logic in afterValidation of step 2.
Any help would be appreciated.
5 Replies
You could try some alpinejs to trigger a jump, but tbh... I would condition the visibility of the step? If they do not use a CSV sheet = false
like
->visible(fn($get) => $get('file_type') !== true)
very rough but idea example.
@toeknee thanks, I tried it. But as step is visible initially, hiding it conditionally still step into this step but without any form.
Maybe this because sheet is next step after file, so File step make sheets its next step, no matter its hidden condationally
So invert it? Visible only when file type is csv?
Or merge it into the same step , and be hidden by default until it's a CSV file that has been uploaded
Thats the approach I adoped. Thanks for the suggestion.