Skip to content

opened

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

Event body

The opened body has a TMenuViewOpenedEventDetail type which represents the details of the toggled menu element. It is optional so it might not exist.

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('Menu view has been opened');
    });
});