Explorar o código

Fix another small bug

Lee Morgan %!s(int64=6) %!d(string=hai) anos
pai
achega
20da707d05
Modificáronse 1 ficheiros con 5 adicións e 0 borrados
  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;