You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you have for instance 5 steps in a wizard component, where a certain step is only shown/visible if a certain field has been set in a previous step. For instance:
Wizard::make([
Wizard\Step::make('street') // step 1Wizard\Step::make('street_extra')->visible(fn (Get$get) => !empty($get('street_extra_enabled')), // step 2Wizard\Step::make('city') // step 3Wizard\Step::make('region'), // step 4Wizard\Step::make('country'), // step 5
])
->startOnStep(function (Get$get, Address$address) {
if($model->region) {
return5; // if region is already set jump to country step
}
if($model->city) {
return4; // if city is already set jump to region step
}
if($model->street_extra) {
return3; // if street_extra is already set jump to city step
}
if($model->street) {
return2; // if street is already set jump to street_extra step
}
return1;
}),
This works only as long as street_extra is visible. If it is not, then filament only counts 4 steps and the returned steps will not longer be correct.
Solutions
A solution could be, if filament also counts "invisible" steps in background.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
If you have for instance 5 steps in a wizard component, where a certain step is only shown/visible if a certain field has been set in a previous step. For instance:
This works only as long as
street_extra
is visible. If it is not, then filament only counts 4 steps and the returned steps will not longer be correct.Solutions
A solution could be, if filament also counts "invisible" steps in background.
Beta Was this translation helpful? Give feedback.
All reactions