{#if label}
{label}
{/if}
{ if (!element_has_focus(searchInputNode)) searchInputNode.focus(); showDropdown = true; }} class:multiple={multiple === true} class:has-selection={hasSelection}> {#if multiple === true && hasSelection} {#each entries.filter((c) => c.selected === true) as entry}
methods.deselect_entry(entry.id)} text={entry.name}/> {/each} {/if}
search.do()} on:click={() => (showDropdown = true)} on:focus={() => (showDropdown = true)} on:blur={search.on_input_focusout} autocomplete="off" />
Open selection
reset(true)}>
Reset selection
{#if errorText}
{errorText}
{/if}
event.code.startsWith("Arrow") && event.preventDefault()} tabindex="-1" class="autocomplete__list"> {#if searchResults.length > 0} {#each searchResults.filter((c) => !c.selected) as result}
methods.select_entry(e.target.dataset.id)} tabindex="-1"> {@html highlight(result, (open = '
'), (close = "
"))}
{/each} {:else if entries.length > 0} {#each entries.filter((c) => !c.selected) as entry}
methods.select_entry(e.target.dataset.id)} tabindex="-1"> {entry.name}
{/each} {:else}
{noResultsText}
{/if}
{#if showCreationHint}
methods.create_entry(searchValue.trim())}/>
{/if}