F
Filament2mo ago
bouly

Trigger next wizard step

Hello, I am looking for a clean way to automatically trigger the next button on StateUpdate while using Wizard. I did this, but it is not clean :
ToggleButtons::make('gender')
->options(...)
->reactive()
->required()
->inline()
->extraAttributes([
'x-on:change' => "setTimeout(() => {
const footerDivs = document.querySelectorAll('.fi-sc-wizard-footer > div');
const nextDiv = Array.from(footerDivs).find(div =>
div.getAttribute('x-on:click') &&
div.getAttribute('x-on:click').includes('requestNextStep') &&
!div.classList.contains('fi-hidden')
);
if (nextDiv) nextDiv.click();
}, 200)"
]),
]),
ToggleButtons::make('gender')
->options(...)
->reactive()
->required()
->inline()
->extraAttributes([
'x-on:change' => "setTimeout(() => {
const footerDivs = document.querySelectorAll('.fi-sc-wizard-footer > div');
const nextDiv = Array.from(footerDivs).find(div =>
div.getAttribute('x-on:click') &&
div.getAttribute('x-on:click').includes('requestNextStep') &&
!div.classList.contains('fi-hidden')
);
if (nextDiv) nextDiv.click();
}, 200)"
]),
]),
Many people try to do this, but I haven't found a cleaner solution. Do you have any ideas? Thanks.
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?