function BrowserUI() {
var currentViewState = "todo";
var taskFocusedBeforeJumpingToInput: HTMLElement | null = null;
+ var lastTagNameEntered = "";
return {
addTask: function (event: KeyboardEvent) {
const input = <HTMLInputElement>document.getElementById("taskName");
const input = document.createElement("input");
input.classList.add("tag");
input.addEventListener("blur", this.completeTagEdit, { once: true });
+ input.value = lastTagNameEntered;
task.appendChild(input);
input.focus();
+ input.select();
event.preventDefault();
},
task.focus();
if (!Model.hasTag(task, newTagName)) {
ui.addTag(task.getAttribute("data-created")!, newTagName);
+ lastTagNameEntered = newTagName;
}
},