Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make search bar and results more accessible #255

Merged
merged 5 commits into from
Oct 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions i18n/en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
- id: search-text
translation: "Search"

- id: search-aria-label
translation: "Search. Press tab to navigate to search results"

- id: 404-title
translation: "404 — Page not found."

Expand Down
7 changes: 5 additions & 2 deletions layouts/partials/header/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,13 @@ <h2 class="h5 offcanvas-title ps-2" id="offcanvasDoksLabel"><a class="text-dark"

{{ if $showFlexSearch -}}
<hr class="text-black-50 my-4 d-lg-none">
<form class="doks-search position-relative flex-grow-1 ms-lg-auto me-lg-2">
<input id="search" class="form-control is-search" type="search" placeholder="{{ i18n "search-text" }}" aria-label="{{ i18n "search-text" }}" autocomplete="off">

<div role="region" aria-live="assertive">
<form class="doks-search position-relative flex-grow-1 ms-lg-auto me-lg-2">
<input id="search" class="form-control is-search" type="search" placeholder="{{ i18n "search-text" }}" aria-label="{{ i18n "search-aria-label" }}" autocomplete="off">
<div id="suggestions" class="shadow bg-white rounded d-none"></div>
</form>
</div>
{{ end -}}

<hr class="text-black-50 my-4 d-lg-none">
Expand Down