From 4ccaa1d6e256ca198e0d15e5b51553edb063f3bf Mon Sep 17 00:00:00 2001 From: Scott Worley Date: Thu, 27 Jan 2022 19:34:24 -0800 Subject: [PATCH 1/1] "x" removes the first tag if a task, rather than a tag, is selected --- vopamoi.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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 { -- 2.44.1