From 7523dc894af60222f05795a43dcae6ecee0b4daa Mon Sep 17 00:00:00 2001 From: Scott Worley Date: Tue, 25 Jan 2022 22:35:52 -0800 Subject: [PATCH 1/1] moveCursor returns whether it was able to or not --- vopamoi.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/vopamoi.ts b/vopamoi.ts index 4e69d0f..bc7acb7 100644 --- a/vopamoi.ts +++ b/vopamoi.ts @@ -26,7 +26,7 @@ const Model = { document.body.appendChild(this.createTask(timestamp, description)).focus(); }, - moveCursor: function (offset: number) { + moveCursor: function (offset: number): boolean { var active = document.activeElement; if (offset === 1 && active) { active = active.nextElementSibling; @@ -34,7 +34,11 @@ const Model = { if (offset === -1 && active) { active = active.previousElementSibling; } - if (active && active instanceof HTMLElement) active.focus(); + if (active && active instanceof HTMLElement) { + active.focus(); + return true; + } + return false; }, }; -- 2.44.1