F
Filament2mo ago
Abrar

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.
No description
5 Replies
toeknee
toeknee2mo ago
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.
Abrar
AbrarOP5w ago
@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
toeknee
toeknee5w ago
So invert it? Visible only when file type is csv?
H4L1M
H4L1M5w ago
Or merge it into the same step , and be hidden by default until it's a CSV file that has been uploaded
Abrar
AbrarOP4w ago
Thats the approach I adoped. Thanks for the suggestion.

Did you find this page helpful?