torgodly
wire:loading Not Triggering During Action Dispatch in Filament
I solved the issue by directly using the
$livewire
instance inside the action method, instead of calling the dispatch method on the class itself. The updated code looks like this:
Tables\Actions\Action::make('test')
->action(function ($record, $livewire) {
$livewire->dispatch('triggerPrint', ...['action' => 'print', 'element' => 1]);
}),
The key difference is that you need to flatten the array of parameters when using the spread operator (...)
.2 replies