diff --git a/src/lib/components/Searchbar.svelte b/src/lib/components/Searchbar.svelte index 216dfaaf..28c9deaa 100644 --- a/src/lib/components/Searchbar.svelte +++ b/src/lib/components/Searchbar.svelte @@ -249,6 +249,12 @@ } } } + + $: { + if (inputValue) { + search(); + } + } (inputValue = "")} class="grow rounded-sm border border-gray-600 py-2 pl-9 text-[1rem] placeholder-gray-400 focus:border-default focus:shadow-lg focus:outline-none focus:ring-0 tiny:pl-8 xs:pl-10 text-white md:py-2 w-full bg-secondary focus:bg-secondary" placeholder="Company or stock symbol..." @@ -349,7 +354,7 @@ {/each} - {:else if inputValue?.length === 0 && !showSuggestions} + {:else if inputValue?.length === 0 || !showSuggestions}
@@ -449,7 +454,6 @@ placeholder="Company or stock symbol..." bind:value={inputValue} bind:this={inputElement} - on:input={search} autocomplete="off" />