X-Git-Url: http://git.scottworley.com/vopamoi/blobdiff_plain/c548954c7a413e97cd4d57b79a9ea33d2b26114f..55c0520e11d12258f0913f11043fc402723339f8:/vopamoi.ts diff --git a/vopamoi.ts b/vopamoi.ts index 0389a04..30efb1b 100644 --- a/vopamoi.ts +++ b/vopamoi.ts @@ -446,6 +446,7 @@ function BrowserUI() { var target = document.activeElement; if (!target) return null; if (target.classList.contains("tag")) target = target.parentElement!; + if (!target.classList.contains("task")) return null; return target as HTMLElement; }, @@ -525,7 +526,11 @@ function BrowserUI() { }, moveCursorVertically: function (offset: number): boolean { - const active = this.currentTask(); + let active = this.currentTask(); + if (!active) { + this.firstVisibleTask()?.focus(); + active = this.currentTask(); + } if (!active) return false; const dest = this.visibleTaskAtOffset(active, offset); if (dest !== active && dest instanceof HTMLElement) {