mirror of
https://github.com/zoldar/jenot.git
synced 2026-01-03 06:22:55 +00:00
Make it easier to focus note form input
This commit is contained in:
parent
8e8c37b1c5
commit
5061e785c4
1 changed files with 14 additions and 0 deletions
|
|
@ -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";
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue