We don't want updates coming in from network sync to move focus around.
task.setAttribute("tabindex", "0");
task.setAttribute("data-created", timestamp);
document.getElementById("tasks")!.appendChild(task);
task.setAttribute("tabindex", "0");
task.setAttribute("data-created", timestamp);
document.getElementById("tasks")!.appendChild(task);
for (const task of document.getElementsByClassName("task")) {
if (task !== target && this.getPriority(task) > priority) {
task.parentElement!.insertBefore(target, task);
for (const task of document.getElementsByClassName("task")) {
if (task !== target && this.getPriority(task) > priority) {
task.parentElement!.insertBefore(target, task);
- target instanceof HTMLElement && target.focus();
return target;
}
}
document.getElementById("tasks")!.appendChild(target);
return target;
}
}
document.getElementById("tasks")!.appendChild(target);
- target instanceof HTMLElement && target.focus();
const input = <HTMLInputElement>document.getElementById("taskName");
if (input.value) {
const task = UI.addTask(input.value);
const input = <HTMLInputElement>document.getElementById("taskName");
if (input.value) {
const task = UI.addTask(input.value);
+ if (task && task instanceof HTMLElement) task.focus();
input.value = "";
if (event.getModifierState("Control")) {
this.setPriority(task, null, document.getElementsByClassName("task")[0]);
input.value = "";
if (event.getModifierState("Control")) {
this.setPriority(task, null, document.getElementsByClassName("task")[0]);
const newPriorityRounded = Math.round(newPriority);
const okToRound = aPriority < newPriorityRounded && newPriorityRounded < bPriority;
UI.setPriority(task.getAttribute("data-created")!, okToRound ? newPriorityRounded : newPriority, Model.getPriority(task));
const newPriorityRounded = Math.round(newPriority);
const okToRound = aPriority < newPriorityRounded && newPriorityRounded < bPriority;
UI.setPriority(task.getAttribute("data-created")!, okToRound ? newPriorityRounded : newPriority, Model.getPriority(task));
+ task instanceof HTMLElement && task.focus();
},
setState: function (state: string) {
},
setState: function (state: string) {