DHCP option focus on firt select (#1421)

This commit is contained in:
Tim Wilkinson 2024-08-28 19:51:16 -07:00 committed by GitHub
parent 5dde2a97ce
commit c216d7dc34
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -628,7 +628,7 @@ if (f) {
const fc = item.firstChild; const fc = item.firstChild;
htmx.find("#ctrl-modal .dialog .dhcp-options .list").appendChild(fc); htmx.find("#ctrl-modal .dialog .dhcp-options .list").appendChild(fc);
refreshAdvOptions(); refreshAdvOptions();
htmx.find(fc, "input").focus(); htmx.find(fc, "select").focus();
htmx.on(fc, "keypress", event => { htmx.on(fc, "keypress", event => {
if (event.keyCode === 13 && event.target.nodeName == "INPUT" && htmx.closest(event.target, ".option") === htmx.find(".dhcp-options .list .option:last-child")) { if (event.keyCode === 13 && event.target.nodeName == "INPUT" && htmx.closest(event.target, ".option") === htmx.find(".dhcp-options .list .option:last-child")) {
event.preventDefault(); event.preventDefault();