I've been utilizing MicroModal for showcasing a modal window. Everything seems to be working smoothly, except for when I try to trigger an event upon closing the modal. It's unclear to me where exactly I should implement this callback function.
Here is the initialization code:
MicroModal.init({
onShow: modal => console.info(`${modal.id} is shown`),
onClose: modal => console.info(`${modal.id} is hidden`),
openTigger : 'data-micromodal-trigger',
closeTrigger: 'data-micromodal-close',
disableScroll: true,
disableFocus: false,
awaitCloseAnimation: false,
debugMode: true,
});
I even attempted to modify the onClose property to directly call my custom event, but unfortunately, it did not execute. For example:
onClose: callMyEvent,
If anyone who has experience with this library could provide some guidance on how to achieve this, I would greatly appreciate it. Thank you.