zwischenstand: bug delete tatort

This commit is contained in:
2025-07-08 14:48:06 +02:00
parent f335f7a13f
commit f5136c2924
7 changed files with 186 additions and 78 deletions

View File

@@ -18,7 +18,6 @@
let names = list.map((l: ListItem) => l.name);
let localName = $state(currentName);
//let names = list;
let wasCancelled = $state(false);
// Automatisch berechneter Fehler
@@ -51,10 +50,11 @@
// Speichern, wenn gültig und zurück an Eltern
function commitIfValid() {
if (!validateName(localName) && !wasCancelled && localName != currentName) {
if (!error && !wasCancelled && localName != currentName) {
editedName = localName.trim();
onSave(editedName, currentName); //Eltern benachrichtigen
} else {
localName = currentName;
resetEdit();
}
}
@@ -74,7 +74,7 @@
commitIfValid();
} else if (event.key === 'Escape') {
event.preventDefault();
editedName = currentName;
localName = currentName;
resetEdit();
}
}