瀏覽代碼

Fix another small bug

Lee Morgan 6 年之前
父節點
當前提交
20da707d05
共有 1 個文件被更改,包括 5 次插入0 次删除
  1. 5 0
      views/dashboardPage/components/components.js

+ 5 - 0
views/dashboardPage/components/components.js

@@ -760,6 +760,11 @@ let newRecipeComp = {
     display: function(){
         let ingredientsSelect = document.querySelector("#recipeInputIngredients select");
         let categories = merchant.categorizeIngredients();
+
+        while(ingredientsSelect.children.length > 0){
+            ingredientsSelect.removeChild(ingredientsSelect.firstChild);
+        }
+
         for(let category of categories){
             let optgroup = document.createElement("optgroup");
             optgroup.label = category.name;