aboutsummaryrefslogtreecommitdiff
path: root/emcclib.js
diff options
context:
space:
mode:
authorBen Harris <bjh21@bjh21.me.uk>2022-11-12 23:39:05 +0000
committerBen Harris <bjh21@bjh21.me.uk>2022-11-23 21:53:59 +0000
commit52cd58043ac144eeafb92fd962662420506283c1 (patch)
treeba3a8401ead53edeea6bc6278d948ed37e26f368 /emcclib.js
parentb1b2da98961c3ec6561a934834026c117f4366d3 (diff)
downloadpuzzles-52cd58043ac144eeafb92fd962662420506283c1.zip
puzzles-52cd58043ac144eeafb92fd962662420506283c1.tar.gz
puzzles-52cd58043ac144eeafb92fd962662420506283c1.tar.bz2
puzzles-52cd58043ac144eeafb92fd962662420506283c1.tar.xz
js: Add keyboard navigation for menus
Once the input focus is in the menu system (for instance by Shift+Tab from the puzzle), you can move left and right through the menu bar and up and down within each menu. Enter selects a menu item. The current menu item is tracked by giving it the input focus.
Diffstat (limited to 'emcclib.js')
-rw-r--r--emcclib.js1
1 files changed, 1 insertions, 0 deletions
diff --git a/emcclib.js b/emcclib.js
index 47963bb..5c1d039 100644
--- a/emcclib.js
+++ b/emcclib.js
@@ -111,6 +111,7 @@ mergeInto(LibraryManager.library, {
var tick = document.createElement("span");
tick.className = "tick";
label.appendChild(tick);
+ label.tabIndex = 0;
label.appendChild(document.createTextNode(" " + name));
item.appendChild(label);
var submenu = document.createElement("ul");