Skip to content

opened

opened is a DOM event that occurs whenever the modal has been opened.

Event body

none

Example

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

useStorefront(async (storefront) => {
    document.addEventListener('opened', () => {
        console.log('A modal has been opened');
    });
});