},
};
+function focusTaskNameInput(event: any) {
+ document.getElementById("taskName")!.focus();
+ event.preventDefault();
+}
+
function handleKey(event: any) {
if (event.target.tagName !== "INPUT") {
- if (event.key == "j") Model.moveCursor(1);
- if (event.key == "k") Model.moveCursor(-1);
- if (event.key == "c") {
- document.getElementById("taskName")!.focus();
- event.preventDefault();
- }
+ if (event.key == "j") return Model.moveCursor(1);
+ if (event.key == "k") return Model.moveCursor(-1);
+ if (event.key == "c") return focusTaskNameInput(event);
}
}