diff --git a/src/ShoppingListItem.js b/src/ShoppingListItem.js index 2d25724..367bb77 100644 --- a/src/ShoppingListItem.js +++ b/src/ShoppingListItem.js @@ -72,7 +72,6 @@ export class ShoppingListItem { const li = document.createElement("li"); const listContent = document.createElement("span"); const removeButton = document.createElement("button"); - const editButton = document.createElement("button"); const doneButton = document.createElement("input"); doneButton.setAttribute("type", "checkbox"); @@ -80,8 +79,7 @@ export class ShoppingListItem { this.isDone = doneButton.checked; }); - editButton.textContent = "Bearbeiten" - editButton.addEventListener("click", () => { + listContent.addEventListener("click", () => { this.isEditing = true; this.onChange(); }); @@ -96,7 +94,6 @@ export class ShoppingListItem { li.appendChild(doneButton); li.appendChild(listContent); - li.appendChild(editButton); li.appendChild(removeButton); return li;