© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•12mo ago•
5 replies
ChesterS

Can't close modal from custom cancel action

I have the following field with a suffix action
 TextInput::make('search')
    ->suffixAction(Action::make('foo')
        ->modalCancelAction(
            Action::make('cancel')
                ->action(function (Set $set,Action $action, $component, $livewire) {

                  //Why won't you close! (╯▔皿▔)╯
                    $livewire->close();
                    $action->cancelParentActions();
                    $action->halt();
                    return;
                })
                ->cancelParentActions( )
//              ->close()
//              ->after(function() {...})
        )
 TextInput::make('search')
    ->suffixAction(Action::make('foo')
        ->modalCancelAction(
            Action::make('cancel')
                ->action(function (Set $set,Action $action, $component, $livewire) {

                  //Why won't you close! (╯▔皿▔)╯
                    $livewire->close();
                    $action->cancelParentActions();
                    $action->halt();
                    return;
                })
                ->cancelParentActions( )
//              ->close()
//              ->after(function() {...})
        )


As you can see, I tried everything I could think of but the modal refuses to close!

The only thing that works is the commented out
->close()
->close()
call, but then the code in the
->action()
->action()
is not actually executed
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

Close Modal After Action from ManageRelatedRecords
FilamentFFilament / ❓┊help
3y ago
First Action Modal doesn't close
FilamentFFilament / ❓┊help
2y ago
Custom close modal button
FilamentFFilament / ❓┊help
2y ago
Custom action modal
FilamentFFilament / ❓┊help
2y ago