Update per100 on select
This commit is contained in:
@@ -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>
|
||||||
|
Reference in New Issue
Block a user