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