Action outside of the panel not showing modals

I have a component outside of the panel:
class Search extends Component implements HasForms, HasActions
{
use InteractsWithActions;
use InteractsWithForms;


public function render(): View
{
return view('livewire.search');
}


public function deleteAction(): Action
{
return Action::make('delete')
->requiresConfirmation()
->action(fn () => dd(1));
}
}
class Search extends Component implements HasForms, HasActions
{
use InteractsWithActions;
use InteractsWithForms;


public function render(): View
{
return view('livewire.search');
}


public function deleteAction(): Action
{
return Action::make('delete')
->requiresConfirmation()
->action(fn () => dd(1));
}
}
<div>
{{ $this->deleteAction }}
</div>
<div>
{{ $this->deleteAction }}
</div>
When clicking on the button, nothing happens, no confirm modal is shown. In Dev-Toolbar I see no error. Only thing I can see is that the attribute disabled=true is set for a second. When I now remove the ->requiresConfirmation() and click again, I can see the dd output. Same goes for custom modals - the modal isn't show. Nothing happens:
Action::make('delete')
->form([
TextInput::make("search")
])
->action(fn () => dd(1));
Action::make('delete')
->form([
TextInput::make("search")
])
->action(fn () => dd(1));
Solution:
did you added the: <x-filament-actions::modals />...
Jump to solution
5 Replies
Solution
Lara Zeus
Lara Zeus4mo ago
did you added the: <x-filament-actions::modals />
bernhard
bernhard4mo ago
🤦‍♂️ I am so stupid. That solved this issue. Just one last question: The button isn't styled right. None of these are
->color(Color::Blue)
->color("primary")
->color(Color::Blue)
->color("primary")
Lara Zeus
Lara Zeus4mo ago
make sure you follow these to add the action to tailwind content https://filamentphp.com/docs/3.x/actions/installation#installing-tailwind-css especially the presets: [preset],
bernhard
bernhard4mo ago
Thanks!
Want results from more Discord servers?
Add your server