Update per100 on select

This commit is contained in:
2024-08-13 19:30:30 +02:00
parent 32563d7d33
commit 1387eecc96

View File

@@ -99,8 +99,9 @@
// return;
// }
// }
function setInputVal(val: string) {
name = val;
function setInputVal(food: main.Food) {
name = food.food;
per100 = String(food.per100)
hiLiteIndex = null;
foodSearch = [];
}
@@ -163,7 +164,7 @@
<FoodSearchEntry
itemLabel={f.food}
highlighted={i == hiLiteIndex}
on:click={() => setInputVal(f.food)}
on:click={() => setInputVal(f)}
/>
{/each}
</ul>