diff options
author | Maxim Devaev <[email protected]> | 2023-04-27 20:23:20 +0300 |
---|---|---|
committer | Maxim Devaev <[email protected]> | 2023-04-27 20:23:20 +0300 |
commit | 3170dcdb575124a6867381b09af6a2a18a6b1278 (patch) | |
tree | c1d562ec397de6ee554d5b647687a0e5b94972fb | |
parent | 70e89f5e0491a96ba51be927dc76c81cfdf28dee (diff) |
web: focus on text area after opening pak menu
-rw-r--r-- | web/kvm/index.html | 2 | ||||
-rw-r--r-- | web/kvm/navbar-text.pug | 2 | ||||
-rw-r--r-- | web/share/js/wm.js | 3 |
3 files changed, 4 insertions, 3 deletions
diff --git a/web/kvm/index.html b/web/kvm/index.html index e76b7c63..b1abd526 100644 --- a/web/kvm/index.html +++ b/web/kvm/index.html @@ -637,7 +637,7 @@ <div class="text"><b>Paste text as keypress sequence<br></b><sub>Please note that PiKVM cannot switch the keyboard layout</sub></div> <hr> <div class="text" style="margin-right: 20px"> - <textarea id="hid-pak-text" placeholder="Enter your text here"></textarea> + <textarea id="hid-pak-text" data-focus placeholder="Enter your text here"></textarea> </div> <table class="kv"> <tr> diff --git a/web/kvm/navbar-text.pug b/web/kvm/navbar-text.pug index 6ae9c810..1c68da40 100644 --- a/web/kvm/navbar-text.pug +++ b/web/kvm/navbar-text.pug @@ -8,7 +8,7 @@ li(id="text-dropdown" class="right") sub Please note that PiKVM cannot switch the keyboard layout hr div(class="text" style="margin-right: 20px") - textarea(id="hid-pak-text" placeholder="Enter your text here") + textarea(id="hid-pak-text" data-focus placeholder="Enter your text here") table(class="kv") tr td diff --git a/web/share/js/wm.js b/web/share/js/wm.js index c8a4c109..9dfbccb1 100644 --- a/web/share/js/wm.js +++ b/web/share/js/wm.js @@ -298,7 +298,8 @@ function __WindowManager() { el_button.classList.add("menu-button-pressed"); el_menu.style.visibility = "visible"; - el_menu.focus(); + let el_focus = el_menu.querySelector("[data-focus]"); + (el_focus !== null ? el_focus : el_menu).focus(); all_hidden &= false; } else { el_button.classList.remove("menu-button-pressed"); |