Skip to content

Commit

Permalink
twig: update aria-labelledby to aria-label for search section, add ro…
Browse files Browse the repository at this point in the history
…le=search to search for accessibility. For #519
  • Loading branch information
poojagunturu96 committed Nov 28, 2023
1 parent 0c80cb4 commit 8cc7b0f
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/templates/partials/midd-header.twig
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,15 @@
</ul>
</nav>

<section class="midd-search" aria-labelledby="midd-search-label">
<h2 class="sr-only" id="midd-search-label">Search</h2>
<section class="midd-search" aria-label="Search">
<a href="/search" class="midd-search__handle" role="button" data-toggle-target=".js-midd-search" data-toggle-group="midd-header" data-toggle-focus=".js-midd-search-input" aria-expanded="false" aria-haspopup="true" aria-labelledby="midd-search__handle-label">
{% include 'partials/icon.twig' with { name: 'search', class: 'midd-search__mag' } %}
{% include 'partials/icon.twig' with { name: 'times', class: 'midd-search__times' } %}
<span class="d-none d-sm-inline" id="midd-search__handle-label">Search</span>
</a>

<div class="midd-search__content js-midd-search">
<form action="https://www.middlebury.edu/search" method="GET">
<label for="midd-search-input" class="sr-only">Search</label>
<form action="https://www.middlebury.edu/search" method="GET" role="search">
<div class="input-group">
<input type="search" class="form-control form-control--sm midd-search__input js-midd-search-input" id="midd-search-input" placeholder="Search" name="q2" required/>
<button type="submit" class="button button--sm midd-search__submit">
Expand Down

0 comments on commit 8cc7b0f

Please sign in to comment.