Skip to content

close

close is a DOM event that occurs whenever the modal is being closed.

Event body

none

Example

In this example we listen to close event and perform an action whenever it's emitted.

useStorefront(async (storefront) => {
    document.addEventListener('close', () => {
        console.log('A modal is being closed');
    });
});