From 3170dcdb575124a6867381b09af6a2a18a6b1278 Mon Sep 17 00:00:00 2001 From: Maxim Devaev Date: Thu, 27 Apr 2023 20:23:20 +0300 Subject: web: focus on text area after opening pak menu --- web/kvm/index.html | 2 +- web/kvm/navbar-text.pug | 2 +- web/share/js/wm.js | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) (limited to 'web') 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 @@
Paste text as keypress sequence
Please note that PiKVM cannot switch the keyboard layout

- +
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"); -- cgit v1.2.3