How to add a confirmation modal before saving while keeping the submit method?

Hey all! I'd like to add a confirmation modal before saving a form, however when I add ->requiresConfirmation to the Action button, it doesn't do anything:
protected function getSaveFormAction(): Action
{
return Action::make('save')
->requiresConfirmation()
->submit('save');
}
protected function getSaveFormAction(): Action
{
return Action::make('save')
->requiresConfirmation()
->submit('save');
}
I found this on X (Twitter): https://x.com/leandrocfe/status/1800169819880472924 This does work, however when I use ->submit(null), I loose a few features. The most relevant in my case is that the action button will no longer get disabled and change the text to "Files uploading..." when there is a file upload taking place. My question is: How can I add a confirmation modal, but preserve the existing functionality of the submit button? Thank you!
Leandro Ferreira (@leandrocfe)
💡 Filament Tip: If you want to enhance the Create Form by adding a confirmation modal before submission, use the following code snippet 👇
From Leandro Ferreira (@leandrocfe)
X
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?