Skip to content

Commit

Permalink
fix: lower score threshold for additional skills matching
Browse files Browse the repository at this point in the history
fix #7
  • Loading branch information
jillro committed Jul 23, 2024
1 parent da0290c commit 6eec95a
Showing 1 changed file with 9 additions and 15 deletions.
24 changes: 9 additions & 15 deletions src/components/AdditionalSkills.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -10,35 +10,29 @@
const fuse = new Fuse(choices, {
keys: ["label"],
minMatchCharLength: 3,
threshold: 0.3,
});
function warning(event: Event) {
const input = event.target as HTMLInputElement;
match = fuse.search(input.value);
}
$: match = fuse.search(value, {
limit: 4,
});
</script>

<input
type="text"
{id}
name={id}
class="form-control"
{value}
on:change={warning}
/>
<input type="text" {id} name={id} class="form-control" bind:value />
{#if match?.length}
<div class="form-text text-danger">
Les compétences existantes suivantes existent déjà et peuvent être ajoutées
directement : {#each match.slice(0, 4) as { item }, i (item.value)}
directement : {#each match as { item }, i (item.value)}
<a
href="#"
on:click|preventDefault|stopPropagation={() => {
add(item.value);
value = "";
}}>{item.label}</a
>
{#if i < match.slice(0, 4).length - 2},
{:else if i < match.slice(0, 4).length - 1}
{#if i < match.length - 2},
{:else if i < match.length - 1}
et
{:else}.{/if}
{/each}
Expand Down

0 comments on commit 6eec95a

Please sign in to comment.