[refactor] improve menu tab index and focus on open

This commit is contained in:
zombieFox 2019-01-06 05:19:18 +00:00
parent 388d30c063
commit 42d732fd39
2 changed files with 4 additions and 3 deletions

View File

@ -89,13 +89,13 @@
<ul class="menu-nav u-list-unstyled">
<li class="menu-nav-item">
<button class="menu-nav-button button button-block button-large active" data-target=".menu-content-area-header">Header</button>
<button class="menu-nav-button button button-block button-large active" data-target=".menu-content-area-header" tabindex="1">Header</button>
</li>
<li class="menu-nav-item">
<button class="menu-nav-button button button-block button-large" data-target=".menu-content-area-bookmarks">Bookmarks</button>
<button class="menu-nav-button button button-block button-large" data-target=".menu-content-area-bookmarks" tabindex="1">Bookmarks</button>
</li>
<li class="menu-nav-item">
<button class="menu-nav-button button button-block button-large" data-target=".menu-content-area-layout">Layout</button>
<button class="menu-nav-button button button-block button-large" data-target=".menu-content-area-layout" tabindex="1">Layout</button>
</li>
</ul>
<div class="menu-content">

View File

@ -46,6 +46,7 @@ var menu = (function() {
var html = helper.e("html");
if (state.get().menu.active) {
helper.addClass(html, "is-menu-open");
helper.e(".menu-nav-button.active").focus();
shade.render({
action: function() {
close();