{#each selectedDocuments as doc (doc.id)}
{/each}
picker.close()}>
{#each selectedDocuments as doc (doc.id)}
{formatDocumentOption(doc)}
removeDocument(doc.id)} class="ml-0.5 text-ink/50 hover:text-red-500 focus:outline-none" aria-label={m.comp_multiselect_remove()} >
{/each}
updateDropdownPosition()} placeholder={placeholder} class="min-w-[120px] flex-1 border-none bg-transparent p-1 text-sm outline-none focus:ring-0" />
{#if picker.isOpen && (filteredResults.length > 0 || picker.loading || picker.error)}
{#if picker.loading}
{m.comp_multiselect_loading()}
{:else if picker.error}
{m.comp_typeahead_error()}
{:else} {#each filteredResults as doc (doc.id)}
selectDocument(doc)} onkeydown={(e) => e.key === 'Enter' && selectDocument(doc)} role="button" tabindex="0" > {formatDocumentOption(doc)}
{/each} {/if}
{/if}