Issue with non-skippable wizard when a step is hidden
Clicking the next on the 2nd step does not do anything when product_type is not cake. It works fine if it is a cake.
public static function form(Form $form): Form
{
return $form
->schema([
Wizard::make([
Wizard\Step::make('Information')
->description(fn ($context) => $context === 'create' ? 'Basic Info!' : null)
->schema([
static::getTypeFormField(),
...
])->columns(2),
Wizard\Step::make('Cake')
->description(fn ($context) => $context === 'create' ? 'Cake Details!' : null)
->schema([
static::getCakeFormField()
])->hidden(
fn (callable $get) => $get('product_type') !== 'cake'
),
Wizard\Step::make('Price')
->description(fn ($context) => $context === 'create' ? 'Price and Sale' : null)
->schema([
static::getPriceSetFormField(),
...
]),
Wizard\Step::make('SEO/Search')
->description(fn ($context) => $context === 'create' ? 'Search Related Info' : null)
->schema([
static::getMetaGroupFormField(),
]),
...
])->columnSpanFull()
->skippable(fn ($context) => $context === 'edit')
]);
}
1 Reply
Anyone has any idea about this? I removed the required() from all the fields in step 2. still I'm facing the same issue
Okay. i figured it's becuase of required() (which was still there).