Skip to content

Commit 8eab427

Browse files
authored
add tab index and fix drop down link issue
1 parent 1615e44 commit 8eab427

File tree

1 file changed

+16
-15
lines changed

1 file changed

+16
-15
lines changed

_includes/masthead.html

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
{% if alink.sub-nav %}
1818
<!-- If there is sub nav to display -->
1919
<li class="dropdown">
20-
<button class="dropbtn">{{ alink.title }} <i class="fas fa-caret-down"></i>
20+
<button class="dropbtn" tabindex="0">{{ alink.title }} <i class="fas fa-caret-down"></i>
2121
</button>
2222
<ul class="dropdown-content">
2323
{% for subnav in alink.sub-nav %}
@@ -33,7 +33,19 @@
3333
</li>
3434
{% endif %}
3535
{% endfor %}
36+
<li>
37+
38+
</li>
3639
</ul>
40+
{% if site.search == true %}
41+
<button class="search__toggle" type="button">
42+
<span class="visually-hidden">{{ site.data.ui-text[site.locale].search_label | default: "Toggle search" }}</span>
43+
<i class="fas fa-search"></i>
44+
</button>
45+
{% endif %}
46+
47+
48+
<ul class="hidden-links hidden"></ul>
3749
<!-- Burger button - span class for screen readers-->
3850
<button class="hamburger__btn-toggle" type="button" count="1">
3951
<span class="visually-hidden">Toggle menu</span> <!--screen readers-->
@@ -42,19 +54,8 @@
4254
</nav>
4355
</div>
4456
</div>
45-
</div>
46-
</div>
47-
{% if site.search == true %}
48-
<button class="search__toggle" type="button">
49-
<span class="visually-hidden">{{ site.data.ui-text[site.locale].search_label | default: "Toggle search" }}</span>
50-
<i class="fas fa-search"></i>
51-
</button>
52-
{% endif %}
53-
<ul class="hidden-links hidden"></ul>
54-
</nav>
55-
</div>
5657
</div>
57-
</div>
58+
5859

5960
<script src="https://code.jquery.com/jquery-3.6.1.min.js" integrity="sha256-o88AwQnZB+VDvE9tvIXrMQaPlFFSUTR+nldQm1LuPXQ=" crossorigin="anonymous"></script>
6061
<script>
@@ -66,8 +67,8 @@
6667
});
6768

6869
$(".dropdown").click(function (e) {
69-
e.stopPropagation();
70-
e.preventDefault();
70+
//e.stopPropagation();
71+
//e.preventDefault();
7172
// close when click outside
7273
$(this).find(".dropdown-content").toggleClass("open");
7374
$(this).siblings(".dropdown").find(".dropdown-content").removeClass("open");

0 commit comments

Comments
 (0)