Bearbeitungsfelder können beim Speichern nicht leer sein

This commit is contained in:
Technoir committed 2026-09-29 10:03:09 +02:00
1 parent e305d7338a
commit 868b120be8
1 file changed
+6
+6
View File
@@ -43,7 +43,13 @@ export class ShoppingListItem {
saveButton.textContent = "Speichern";
editForm.addEventListener("submit", (event) => {
event.preventDefault();
const editFormData = Object.fromEntries(new FormData(editForm));
if (!editFormData.newItemName && !editFormData.newItemAmount) {
return;
}
this.name = editFormData.newItemName;
this.amount = editFormData.newItemAmount;
this.isEditing = false;