{#await suggestionsPromise} ... {:then suggestions} {#each suggestions as suggestion, index} setSelectedAndActive(index)} on:mouseup={() => { selectIndex(index); chooseSelected(); }} on:mouseenter={(event) => selectIfMousedown(event, index)} on:mouseleave={() => (active = false)} >{suggestion} {/each} {/await}