FilamentF
Filament6mo ago
Yash

Prevent Modal from closing on submit.

On my view page i have action which is a modal (slideover) and after submit i do not want to close the modal. how to achieve this.
one way is to use extraModalFooterActions and disable the default action, but this is just a workaround and due to this the submit validation does not triggered.
i need the proper solution for this

Action::make('notes')
        ->slideOver()
        ->closeModalByClickingAway(false)
        ->form(function (\Filament\Actions\Action $action) {
            //INPUT AND FORM COMPONENTS
        })
        ->action(function (Action $action, $record, array $data) {
             //SAVING THE DATA
            //DO NOT WANT TO CLOSE THIS MODAL/SLIDEOVER
        })
Was this page helpful?