fix: list cell now remembers the last ingredient selected
This commit is contained in:
parent
a32f4cd781
commit
0da9490a60
1 changed files with 3 additions and 1 deletions
|
|
@ -135,7 +135,9 @@ public class IngredientListCell extends OrderedEditableListCell<RecipeIngredient
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private HBox makeInputLine(RecipeIngredient ingredient, TextField amountInput, ChoiceBox<Unit> unitChoice) {
|
private HBox makeInputLine(RecipeIngredient ingredient, TextField amountInput, ChoiceBox<Unit> unitChoice) {
|
||||||
MenuButton ingredientSelect = new MenuButton(getLocaleString("app.prompt.select-ingredient"));
|
selectedIngredient.setValue(ingredient.getIngredient());
|
||||||
|
MenuButton ingredientSelect = new MenuButton(selectedIngredient.get() == null ?
|
||||||
|
getLocaleString("app.prompt.select-ingredient") : selectedIngredient.get().getName());
|
||||||
HBox container = new HBox(amountInput, unitChoice, ingredientSelect);
|
HBox container = new HBox(amountInput, unitChoice, ingredientSelect);
|
||||||
try {
|
try {
|
||||||
makeMenuItems(ingredientSelect, server.getIngredients(), Ingredient::getName, i -> {
|
makeMenuItems(ingredientSelect, server.getIngredients(), Ingredient::getName, i -> {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue