How to Programmatically Navigate to a Specific Step in a Wizard

How can I programmatically navigate to step 2 ("Delivery") using a function call or dispatch in Livewire?

I tried:
Livewire.dispatch('next-wizard-step', { statePath: 'mountedTableActionsData.2' });

However, it's not behaving accurately. Sometimes it goes to step 2, but other times it skips to step 3.

 Wizard::make([
    Wizard\Step::make('Order')
        ->schema([
            // ...
        ]),
    Wizard\Step::make('Delivery')
        ->schema([
            // ...
        ]),
    Wizard\Step::make('Billing')
        ->schema([
            // ...
        ]),
])
Solution
Wizard::make([...
])
->extraAlpineAttributes(['@update-step.window' => 'step = event.detail.newStep'])


$dispatch('update-step', {newStep: 'delivery'})
Was this page helpful?