{ e.preventDefault(); page = 1; videos = []; await searchVideos(); }} >
{ // A delay before clearing the suggestions allows the user to click on a suggestion // Clicking the suggestion will trigger the blur event immediately, and the search won't happen setTimeout(() => { suggestions = { suggestions: [] }; }, 200); }} />
{#if suggestions.suggestions.length > 0} {/if}
{#each videos as video} {#if video.type === "video"} {:else if video.type === "playlist"} {:else if video.type === "channel"} {/if} {/each}
{#if !isLoading && videos.length > 0 && searchBoxText}
{/if} {#if isLoading}
{/if}