Skip to content

Commit 83bb4d7

Browse files
committed
Attempt to allow tabbing of menu items
1 parent a97e2ce commit 83bb4d7

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/utils/menu.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,13 @@ const menu = (() => {
1818
.menu-body { background-color: rgba(0,0,0,0.6); min-height: 250px; }
1919
.menu-body ul { list-style: none; padding: 0; }
2020
.menu-body li { list-style-type: none; border: 1px solid #fff; width: 80%; text-align: center; margin: 5px auto; opacity: 1; }
21-
.menu-body li:hover { text-decoration: underline; opacity: 0.4; }
21+
.menu-body li:hover, .menu-body li:focus { text-decoration: underline; opacity: 0.4; }
2222
</style>`);
2323
body = $('<div class="menu-body">');
2424
wrapper = $('<div class="menu-backdrop">')
25+
.attr({
26+
role: 'Menu',
27+
})
2528
.append($('<div class="menu-content">')
2629
.append(
2730
`<div class="menu-header"><span class="menu-close right">&times;</span>MENU</div>`,
@@ -41,8 +44,13 @@ const menu = (() => {
4144
// Generate buttons
4245
if (!cooked) {
4346
body.html(''); // Clear current buttons
47+
let index = 1;
4448
buttons.forEach((data) => {
4549
const button = $('<li>');
50+
button.attr({
51+
role: 'button',
52+
tabindex: index++,
53+
});
4654
if (data.url) {
4755
// Make text a url
4856
} else {

0 commit comments

Comments
 (0)