open ? close() : void show()} onkeydown={handleKeydown} >
{#if showSelectedGroup && selectedOption?.group}
{selectedOption.group}
{/if}
{selectedOption?.label ?? placeholder}
{#if open}
{#if searchable}
= 0 ? `${menuId}-option-${activeIndex}` : undefined} onkeydown={handleKeydown} oninput={async () => { await tick(); activeIndex = enabledIndices[0] ?? -1; positionMenu(); }}/>
{/if}
{#each visibleOptions as option, index (`${option.value}:${index}`)} {#if option.group && (index === 0 || visibleOptions[index - 1]?.group !== option.group)}
{option.group}
{groupCount(option.group)}
{/if}
{ if (!option.disabled) activeIndex = index; }} onclick={() => choose(index)} >
{option.label}
{#if option.value === value}
{/if}
{/each}
{#if searchable && !visibleOptions.length}
{emptyText}
{/if}
{/if}