Table action with form - confirmation before submit

Hello, I am trying to add confirmation (or any kind of modal action) when user clicks submit on a table action with a form. I have tried with extraModalFooterActions, that contains requiresConfirmation(), which when clicked does show the confirmation (but closes the parent modal, i thought it just displays over it?), but then cancelParentActions() doesn't work, reopening the parent modal again. Code for extraModalFooterActions:
use Filament\Tables\Actions\Action;
$this->extraModalFooterActions([
Action::make('confirm')
->requiresConfirmation()
->action(function ($record) {
$this->cancelParentActions();
\Log::debug('confirmed');
})
]);
use Filament\Tables\Actions\Action;
$this->extraModalFooterActions([
Action::make('confirm')
->requiresConfirmation()
->action(function ($record) {
$this->cancelParentActions();
\Log::debug('confirmed');
})
]);
Has anyone had similar issues, and if so how did you resolve it?
Solution:
inject the action ```php ->action(function (Action $action) { $action->cancelParentActions();...
Jump to solution
4 Replies
Solution
LeandroFerreira
inject the action
->action(function (Action $action) {
$action->cancelParentActions();
})
->action(function (Action $action) {
$action->cancelParentActions();
})
@maticl
@maticlOP3w ago
Hey, thanks for the help, it works now 🙈 missread the docs... Hijacking the thread, is there a way to pass parent form data into child? Currently having issues with this.
LeandroFerreira
open a new topic and explain what you are trying to do please

Did you find this page helpful?