From: Scott Worley Date: Fri, 28 Jan 2022 03:34:24 +0000 (-0800) Subject: "x" removes the first tag if a task, rather than a tag, is selected X-Git-Url: http://git.scottworley.com/vopamoi/commitdiff_plain/4ccaa1d6e256ca198e0d15e5b51553edb063f3bf?ds=inline "x" removes the first tag if a task, rather than a tag, is selected --- diff --git a/vopamoi.ts b/vopamoi.ts index 17d81b6..fe97410 100644 --- a/vopamoi.ts +++ b/vopamoi.ts @@ -382,9 +382,14 @@ function BrowserUI() { }, removeTag: function () { - const tag = document.activeElement; - if (!tag || !tag.classList.contains("tag")) return; - ui.removeTag(tag.parentElement!.getAttribute("data-created")!, tag.textContent!); + var target = document.activeElement; + if (!target) return; + if (target.classList.contains("task")) { + const tags = target.getElementsByClassName("tag"); + target = tags[tags.length - 1]; + } + if (!target || !target.classList.contains("tag")) return; + ui.removeTag(target.parentElement!.getAttribute("data-created")!, target.textContent!); }, returnFocusAfterInput: function (): boolean {