From e9daac5fc4b8c112a3d32fc892e9679c0038c32f Mon Sep 17 00:00:00 2001 From: Michael Genson <71845777+michael-genson@users.noreply.github.com> Date: Wed, 18 Feb 2026 16:37:32 -0600 Subject: [PATCH] feat: Auto-adjust shopping list item autofocus (#7096) --- .../Domain/ShoppingList/ShoppingListItemEditor.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frontend/components/Domain/ShoppingList/ShoppingListItemEditor.vue b/frontend/components/Domain/ShoppingList/ShoppingListItemEditor.vue index 120e19a51..9ec86821c 100644 --- a/frontend/components/Domain/ShoppingList/ShoppingListItemEditor.vue +++ b/frontend/components/Domain/ShoppingList/ShoppingListItemEditor.vue @@ -30,6 +30,7 @@ :items="foods" :label="$t('shopping-list.food')" :icon="$globals.icons.foods" + :autofocus="autoFocus === 'food'" create @create="createAssignFood" /> @@ -41,7 +42,7 @@ :label="$t('shopping-list.note')" rows="1" auto-grow - autofocus + :autofocus="autoFocus === 'note'" @keypress="handleNoteKeyPress" /> @@ -165,6 +166,8 @@ export default defineNuxtComponent({ }, ); + const autoFocus = !listItem.value.food && listItem.value.note ? "note" : "food"; + async function createAssignFood(val: string) { // keep UI reactive // eslint-disable-next-line @typescript-eslint/no-unused-expressions @@ -204,6 +207,7 @@ export default defineNuxtComponent({ return { listItem, + autoFocus, createAssignFood, createAssignUnit, assignLabelToFood,