{#if visible}
{ e.preventDefault(); e.stopPropagation(); onClose(); }} onclick={(e) => { e.preventDefault(); e.stopPropagation(); onClose(); }} oncontextmenu={(e) => { e.preventDefault(); e.stopPropagation(); onClose(); }} onkeydown={(e) => { if (e.key === 'Escape') onClose(); }} role="presentation" tabindex="-1" >
e.stopPropagation()} oncontextmenu={(e) => e.preventDefault()} onkeydown={handleKeyDown} > {#each items as item, index} {#if item.type === 'divider'}
{:else}
handleItemClick(item)} role="menuitem" disabled={item.disabled} > {#if item.toggle}
{:else if item.icon}
{/if}
{item.label}
{#if item.shortcut}
{item.shortcut}
{/if}
{/if} {/each}
{/if}