Merge branch 'bugfix/autocomplete' into dev
Build Docker Image / Docker-Build (push) Successful in 3m13s
Build Docker Image / Clean-Registry (push) Has been cancelled

This commit is contained in:
2026-05-22 08:26:25 +02:00
2 changed files with 9 additions and 3 deletions
+1
View File
@@ -116,6 +116,7 @@
<Route path="/project/:project_id/add_task" component={AddTask} />
<Route path="/project/:id/kanban" component={Kanban} />
<Route path="/project/:id/view" component={ViewPrj} />
<Route path="/project/:id" component={ViewPrj} />
<Route path="/search" component={Search} />
<Route path="/stock" component={Stock} />
<Route path="/stock/location/:location_id" component={Stock} />
+8 -3
View File
@@ -63,6 +63,11 @@
selected = null;
}
function onblur(ev){
candidates = [];
selected = null;
}
async function onkeyup(ev){
if (ignore.includes(ev.key)) return;
if (ev.key == 'ArrowDown'){
@@ -145,11 +150,11 @@
</style>
<span class="autocomplete">
<input type="text" bind:value={candidate.display} {onkeyup} autofocus={autofocus} {id} />
<input type="text" bind:value={candidate.display} {onkeyup} autofocus={autofocus} {id} {onblur} />
{#if candidates && candidates.length > 0}
<ul bind:this={list_elem} class="suggestions">
<ul bind:this={list_elem} class="suggestions" tabindex="-1">
{#each candidates as candidate,i}
<li class="option {selected==i?'highlight':''}" onclick={e => select(i)} ondblclick={e => select(i)}>{candidate.display}</li>
<li class="option {selected==i?'highlight':''}" tabindex="-1" onclick={e => select(i)} ondblclick={e => select(i)}>{candidate.display}</li>
{/each}
</ul>
{/if}