diff --git a/priv/static/js/components.js b/priv/static/js/components.js index 0fb92e5..cdd0b0d 100644 --- a/priv/static/js/components.js +++ b/priv/static/js/components.js @@ -456,6 +456,20 @@ class NoteForm extends HTMLElement { this.addButton = this.querySelector(".add"); this.saveButton = this.querySelector(".save"); + this.addEventListener("click", (e) => { + if ( + !( + e.target instanceof HTMLInputElement || + e.target instanceof HTMLButtonElement || + e.target instanceof HTMLTextAreaElement + ) + ) { + this.content.querySelector("textarea")?.focus(); + } + + return true; + }); + this.tasklistModeButton.addEventListener("click", (e) => { e.preventDefault(); this.note.type = "tasklist";