aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Harris <bjh21@bjh21.me.uk>2022-11-24 16:37:26 +0000
committerBen Harris <bjh21@bjh21.me.uk>2022-12-10 21:54:11 +0000
commit3150d72800ec9f49001bf568df224375ea133747 (patch)
tree66ae07f62b03ffaad05303ca61b6ce6ceffb2ed9
parentebb7b4277e2440e66b65ac910a6af143bd2833d8 (diff)
downloadpuzzles-3150d72800ec9f49001bf568df224375ea133747.zip
puzzles-3150d72800ec9f49001bf568df224375ea133747.tar.gz
puzzles-3150d72800ec9f49001bf568df224375ea133747.tar.bz2
puzzles-3150d72800ec9f49001bf568df224375ea133747.tar.xz
js: When opening a dialogue box, try to focus it
This will make using menus from the keyboard more convenient.
-rw-r--r--emccpre.js1
1 files changed, 1 insertions, 0 deletions
diff --git a/emccpre.js b/emccpre.js
index 318f799..8e957a0 100644
--- a/emccpre.js
+++ b/emccpre.js
@@ -251,6 +251,7 @@ function dialog_launch(ok_function, cancel_function) {
document.body.appendChild(dlg_dimmer);
document.body.appendChild(dlg_form);
+ dlg_form.querySelector("input,select,a").focus();
}
function dialog_cleanup() {