+ {#each selectedDocuments as doc (doc.id)}
+
+ {formatDocLabel(doc)}
+
+
+ {/each}
+
+
{
+ updateDropdownPosition();
+ showDropdown = true;
+ }}
+ placeholder={placeholder}
+ class="min-w-[120px] flex-1 border-none bg-transparent p-1 text-sm outline-none focus:ring-0"
+ />
+
+ {#if loading}
+
{m.comp_multiselect_loading()}
+ {:else}
+ {#each results as doc (doc.id)}
+
selectDocument(doc)}
+ onkeydown={(e) => e.key === 'Enter' && selectDocument(doc)}
+ role="button"
+ tabindex="0"
+ >
+ {formatDocLabel(doc)}
+
+ {/each}
+ {/if}
+