How to know when a modal, opened via a Table action, has been closed?
I need to dispatch an event when a modal is closed. Right now I can do it when the "submit" button is clicked with
But I can not figure out how to do this on cancel. I've tried overriding by way of
This feels like progress because the correct code gets executed when the respective button gets clicked; however, it also feels like I'm moving backwards, because the modal doesn't automatically close like it would do out of the box using just
I thought that
But I can not figure out how to do this on cancel. I've tried overriding by way of
modalFooterActions with something like this:This feels like progress because the correct code gets executed when the respective button gets clicked; however, it also feels like I'm moving backwards, because the modal doesn't automatically close like it would do out of the box using just
action. So I solve one problem but encounter a new I thought that
modalCancelAction would be the way, but that is getting executed when the modal is being rendered so I must be misunderstanding its intention.Solution
Ok. I think it’s because you’re trying to override the existing actions without actually replacing the existing submit and close that are already cached. Try this approach instead: https://filamentphp.com/docs/3.x/actions/modals#modifying-a-default-modal-footer-action-button