Modal Action with Custom Livewire component

Hello everyone, I'm facing an issue with an action in a custom Livewire component. Upon clicking a button, a modal opens with a file uploader inside. Everything seems to be working correctly, but I just can't figure out why the "->action(//mycode....)" method doesn't seem to be triggered upon confirming the action. In fact, upon submitting the modal, I'm redirected back with a 'Saved' success notification. How is it possible that my dd($data) isn't being triggered? What am I missing?

Livewire Controller:

class CreateOpenFundsD extends Component implements HasForms, HasActions
{
    use InteractsWithActions;
    use InteractsWithForms;
    use WithFileUploads;

public function mount(): void
    {
      //....
    }

    public function form(Form $form): Form
    {
        //Only half of my form... (the other one is rendered in the livwire component view)
    }

    public function importHeadersAction(): Action
    {
        return Action::make('importHeaders')
            ->label('Importa Headers')
            ->form([
                FileUpload::make('attachment')
                            ->storeFiles(false)
                            ->label('Carica File (CSV o XLSX)')
                            ->acceptedFileTypes(['text/csv', 'application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'])
                            ->columnSpan(6)
            ])
            ->action(function ($data) {
                dd($data); //how this method is not triggered?
            });

    }


Livewire view:

<form wire:submit="createOrUpdate">
        {{ $this->form }}
  

         <div>
              {{ $this->importHeaders }}
 
              <x-filament-actions::modals />
          </div>

          //other things.....
 </form>

Thanks to anyone will help! Bye 🙂
Was this page helpful?