ソースを参照

When editing ingredients, focus is placed on the quantity

Lee Morgan 6 年 前
コミット
f099eaf29c
2 ファイル変更4 行追加0 行削除
  1. 2 0
      views/inventoryPage/inventory.js
  2. 2 0
      views/recipesPage/singleRecipe.js

+ 2 - 0
views/inventoryPage/inventory.js

@@ -112,6 +112,8 @@ let inventoryObj = {
 
         removeButton.innerText = "Cancel";
         removeButton.onclick = ()=>{this.cancelEdit(id, row, originalQuantity)};
+
+        quantityInput.focus();
     },
 
     cancelEdit: function(id, row, amount){

+ 2 - 0
views/recipesPage/singleRecipe.js

@@ -205,6 +205,8 @@ let singleRecipeObj = {
         let removeButton = row.children[2].children[1];
         removeButton.innerText = "Cancel";
         removeButton.onclick = ()=>{this.cancelEdit(row, ingredient, recipe)};
+
+        input.focus();
     },
 
     cancelEdit: function(row, ingredient, recipe){