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;
},
},
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) {