Problems closing a parent modal
Hi there! I a have a Filament Table for invoices that opens a modal with invoice details using the ViewAction when clicking on a table row. The modal is rendered with a custom blade view. Somewhere inside that view I have a Livewire Component with an InfoList. This is where I placed a delete action for the currently opened invoice.
Deleting the invoice works fine. However, I am immediately greeted with various exceptions, probably because the ViewAction modal is trying to refresh with a record that obviously doesn't exist anymore. Is there a way to make my delete action work and send some Livewire event or something else to have the parent modal close?
I don't have any issues when I put the action from my InfoList into the ViewAction using
->extraModalFooterActions([DeleteAction::make()->cancelParentActions()])
. However, I would like to place my action inside the modal content in my infolist for various UI reasons.1 Reply
I still would be interested in an answer, but I found a workaround that is sufficient for my use case:
First I was using the feature described here: https://filamentphp.com/docs/3.x/actions/modals#adding-an-action-to-custom-modal-content. This way I could register a proper DeleteAction and at least pass it to the modal blade View.
I then removed the Section Component from my infolist and instead wrapped the whole InfoList-Livewire-Component in Filaments Section Blade Component: https://filamentphp.com/docs/3.x/support/blade-components/section. There I could place the Action buttons using the endHeader Slot.
I ended up with the identical looking UI, but my Actions are now definied within the ViewAction and passed down to the modalContent.