svelte-typeahead icon indicating copy to clipboard operation
svelte-typeahead copied to clipboard

Allow setting a threshold score for result to be considered a match

Open thedivtagguy opened this issue 6 months ago • 0 comments

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: image

Allowing for something like this to be set so only very close matches are shown would be nice.

thedivtagguy avatar Dec 24 '23 17:12 thedivtagguy