Hook for when action modal is closed
Donate 💰 to fund this issue
- You can donate funding to this issue. We receive the money once the issue is completed & confirmed by you.
- 100% of the funding will be distributed between the Filament core team to run all aspects of the project.
- Thank you in advance for helping us make maintenance sustainable!
Hey, do you mind if I submit a PR for this? If I may, should I rename the after() hook to afterSubmit()? Then I can create afterClose/afterCancel() to avoid confusion. Or should I keep it just as afterClose()?
Before implementing this I would like someone to reply here and let me know what use case they have for this hook, so that I can make sure needs are met. I have heard a lot of requests for this but would like to extra clarification before proceeding.
Before implementing this I would like someone to reply here and let me know what use case they have for this hook, so that I can make sure needs are met. I have heard a lot of requests for this but would like to extra clarification before proceeding.
I personally have no use for it, I made the PR because there was an issue for it. During the summer I accidentally deleted it though 😅. I can make it again if thats ok. If there is no use for the PR, we can ignore it.
Yeah I'm just struggling to imagine how you would use it, hence why I haven't merged it
Example usage:
- The user needs to get onboarded to a page
- So you call an action modal on load
- The user reads the description in the modal and then closes the modal
- On close, set has_seen_xpage_onboarding to true on the user model
Should you not do that when the modal is opened, mountUsing()? So then it still gets recorded if you close the browser instead of the modal?
I have a use case for this... I have a module that automatically opens unread announcements for users... one by one, so after the user closes, it automatically opens the next one...
But i can think of many use cases for this, like setting the modal as read, maybe you want to track when the user opens it, but also when you closed... etc...
Would that not be better with "Next" and "Previous" buttons in the modal footer instead of shoving each announcement in the user's face when they try and quit?
Yeah sorry guys but as per our discussion I am still not convinced this is useful, and I think the implementation is pretty tricky to catch every case where a modal is "closed". Going to cancel the feature for now, might reconsider again in the future if I hear some good use cases.