Skip to content

toggle

toggle is a DOM event that occurs whenever the dropdown gets toggled.

Event body

none

Example

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

useStorefront(async (storefront) => {
    document.addEventListener('toggle', () => {
        console.log('toggle dropdown');
    });
});