forked from mmistakes/minimal-mistakes
-
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.
Fixes aria issues on search form (mmistakes#2211)
* Fixes aria issues on search form * Swapping aria-label for <label> tag in search * Removing background gray caused by adding <form> tag to search * Removing redundant space * Making form not submit if key is enter Close mmistakes#2180
- Loading branch information
Showing
3 changed files
with
28 additions
and
13 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
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,18 +1,26 @@ | ||
<div class="search-content__inner-wrap"> | ||
{%- assign search_provider = site.search_provider | default: "lunr" -%} | ||
{%- case search_provider -%} | ||
{%- assign search_provider = site.search_provider | default: "lunr" -%} | ||
{%- case search_provider -%} | ||
{%- when "lunr" -%} | ||
<input type="search" id="search" aria-placeholder="{{ site.data.ui-text[site.locale].search_placeholder_text | default: 'Enter your search term...' }}" class="search-input" tabindex="-1" placeholder="{{ site.data.ui-text[site.locale].search_placeholder_text | default: 'Enter your search term...' }}" /> | ||
<div id="results" class="results"></div> | ||
<form class="search-content__form" onkeydown="return event.key != 'Enter';"> | ||
<label class="sr-only" for="search"> | ||
{{ site.data.ui-text[site.locale].search_label_text | default: 'Enter your search term...' }} | ||
</label> | ||
<input type="search" id="search" class="search-input" tabindex="-1" placeholder="{{ site.data.ui-text[site.locale].search_placeholder_text | default: 'Enter your search term...' }}" /> | ||
</form> | ||
<div id="results" class="results"></div> | ||
{%- when "google" -%} | ||
<form onsubmit="return googleCustomSearchExecute();" id="cse-search-box-form-id"> | ||
<input type="search" id="cse-search-input-box-id" aria-placeholder="{{ site.data.ui-text[site.locale].search_placeholder_text | default: 'Enter your search term...' }}" class="search-input" tabindex="-1" placeholder="{{ site.data.ui-text[site.locale].search_placeholder_text | default: 'Enter your search term...' }}" /> | ||
</form> | ||
<div id="results" class="results"> | ||
<gcse:searchresults-only></gcse:searchresults-only> | ||
</div> | ||
<form onsubmit="return googleCustomSearchExecute();" id="cse-search-box-form-id"> | ||
<label class="sr-only" for="cse-search-input-box-id"> | ||
{{ site.data.ui-text[site.locale].search_label_text | default: 'Enter your search term...' }} | ||
</label> | ||
<input type="search" id="cse-search-input-box-id" class="search-input" tabindex="-1" placeholder="{{ site.data.ui-text[site.locale].search_placeholder_text | default: 'Enter your search term...' }}" /> | ||
</form> | ||
<div id="results" class="results"> | ||
<gcse:searchresults-only></gcse:searchresults-only> | ||
</div> | ||
{%- when "algolia" -%} | ||
<div class="search-searchbar"></div> | ||
<div class="search-hits"></div> | ||
{%- endcase -%} | ||
<div class="search-searchbar"></div> | ||
<div class="search-hits"></div> | ||
{%- endcase -%} | ||
</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