{ 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); }} />
{ page = 1; videos = []; await searchVideos(); }} >
{searchFiltersLabel}
{#if suggestions.suggestions.length > 0}
{#each suggestions.suggestions as suggestion}
{ await suggestionClicked(e.currentTarget.innerText); }}>{@html suggestion}
{/each}
{/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}
{ page++; await searchVideos(); }} > Load more
{/if} {#if isLoading}
{/if}