forked from ScottLogic/blog
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
<select> in compact category list has an accessible label (ScottLogic…
- Loading branch information
1 parent
aa0c7bc
commit 3bb95ba
Showing
3 changed files
with
18 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,19 @@ | ||
{% assign selectedIndex = include.selectedIndex %} | ||
<div class="category-list-compact dropdown-menu grid-x grid-margin-y align-center"> | ||
<div class = "cell medium-5 small-5"> | ||
<h3>Categories</h3> | ||
<select onchange="location = this.options[this.selectedIndex].value"> | ||
{% for category in site.data.categories %} | ||
<option {% if selectedIndex == forloop.index0 %}selected="selected"{% endif %} | ||
value="{{ site.baseurl }}{{ category.url }}">{{ category.title }}</option> | ||
{% endfor %} | ||
<label for="category-select"> | ||
Category | ||
</label> | ||
|
||
<select id="category-select" onchange="location = this.options[this.selectedIndex].value"> | ||
{% for category in site.data.categories %} | ||
<option | ||
{% if selectedIndex == forloop.index0 %} selected="selected" {% endif %} | ||
value="{{ site.baseurl }}{{ category.url }}" | ||
> | ||
{{ category.title }} | ||
</option> | ||
{% endfor %} | ||
</select> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters