svelte-typeahead
svelte-typeahead copied to clipboard
Allow setting a threshold score for result to be considered a match
I'd like to be able to set a threshold on what is considered a match. This is what I do right now:
<Typeahead
hideLabel
label="Search works"
placeholder="Try me..."
{data}
{extract}
let:result
let:value
>
{#if result.score >= 20}
<div>
<strong>{getTitle(result.original)}</strong>
</div>
{/if}
</Typeahead>
This kinda works, but I still see empty boxes where the results below threshold are:
Allowing for something like this to be set so only very close matches are shown would be nice.