© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
3 replies
technocrat

Wizard Step event dispatching issue inside aftervaliadtion()

I'm having trouble opening a modal in during the step form validation. Here's what my code looks like:
Step::make('step1')
    ->schema([])
    ->aftervalidation(function(){
         $this->dispatch('open-modal', id: 'posmodal');
        // other logic codes ..........

    });
Step::make('step1')
    ->schema([])
    ->aftervalidation(function(){
         $this->dispatch('open-modal', id: 'posmodal');
        // other logic codes ..........

    });

The issue is that the modal only opens after the entire code execution of aftervalidation, instead of when the next button is clicked means at the starting of aftervalidation code execution. My goal is to display the modal on next button click and keep it open until a specific code is executed inside fo the aftervalidation().

I've set up a JavaScript listener, but it seems the dispatch event is only happening after whole the code execution.

Is there any way i can open the modal instantaneously on next button click ?
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Create 'check' step inside wizard.
FilamentFFilament / ❓┊help
3y ago
Dispatching Event after Action
FilamentFFilament / ❓┊help
3y ago
wizard step label
FilamentFFilament / ❓┊help
8mo ago
Polling step wizard
FilamentFFilament / ❓┊help
16mo ago