Close Modal "hook"
I have quite a few different actions on different pages that open a modal to view or edit a record. Im working on a solution to have a share action that will copy the current records url (querystring) to the users clipboard and while Ive definitely launched modal using a url, ive always found it to be a pain to remove that querystring when the use closes the modal by clicking away, etc. Any suggestions for creating a solution that works in most situations for when a modal might close (submit, close, cancel, escape, navigate away, etc) for removing that query string reference? Though as i typed this out though, i am wondering if I should remove that querystring parameter after the modal is launched in the first place.
2 Replies
A browser event "close-modal" is fired to close the modal, maybe you can listen to it on Alpine?
Hmm, I definitely want to implement something easy to manage though. Wondering if I should extend the modal component. Though while that would be easier to do with the standalone version there you have to add it to your blade files anyway, it wouldn’t migrate well to the panel builder when we move to it