web: focus on text area after opening pak menu

This commit is contained in:
Maxim Devaev 2023-04-27 20:23:20 +03:00
parent 70e89f5e04
commit 3170dcdb57
3 changed files with 4 additions and 3 deletions

View File

@ -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>

View File

@ -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

View File

@ -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");