open = false}
on:click={handleClickOutside}
>
{#if value}
{value.title}
{:else}
open = true}
on:input={handleSearch}
/>
{/if}
{#if search?.length >= 3}
{#if models?.length > 0}
{#each models as model}
- {
open = false;
onChange(model)
}}
/>
{/each}
{:else}
{/if}
{:else}
{#each defaultModels as model}
- {
open = false;
onChange(model)
}}
/>
{/each}
{/if}