Open action modals inside a modal
Hi everyone,
I have a form to edit a resource, following there will be the code. I render this form inside a filament blade modal that I handle using Alpine.js.
I have two questions, can I put a submit button as a action? So using the builder instead of writing it into the template.
Second question, can I use requiresConfirmation() inside the modal? Because it doesn't work. To be fair I tried it also outside the modal and It doesn't work. No js error, it just goes straight with the request.
public function editTaskForm(Form $form): Form
{
return $form
->schema([
TextInput::make('name')
->required(),
Textarea::make('description'),
DatePicker::make('start_date')
->required(),
DatePicker::make('end_date')
->required(),
Actions::make([
Action::make('Delete task')
->link()
->color('danger')
->action('deleteTask')
->requiresConfirmation()
])
])->statePath('editTaskData');
}
<x-filament::modal id="edit-task">
<x-slot name="heading">
Modifica il task
</x-slot>
<x-slot name="description">
Modal description
</x-slot>
<form wire:submit="editTask">
{{ $this->editTaskForm }}
<x-filament::button type="submit">
Submit
</x-filament::button>
<x-filament-actions::modals />
</form>
</x-filament::modal>
1 Reply
Solution
Seems like "<x-filament-actions::modals />" broke the action modals.