},
hasTag: function (task: Element, tag: string): Element | null {
- for (const child of task.children) {
- if (child.classList.contains("tag") && child.textContent === tag) {
+ for (const child of task.getElementsByClassName("tag")) {
+ if (child.textContent === tag) {
return child;
}
}
input.removeEventListener("blur", this.completeTagEdit);
task.removeChild(input);
task.focus();
- if (!Model.hasTag(task, newTagName)) {
+ if (resolution === CommitOrAbort.Commit && newTagName && !Model.hasTag(task, newTagName)) {
ui.addTag(task.getAttribute("data-created")!, newTagName);
lastTagNameEntered = newTagName;
}