fix: Rephrase search label; add an aria description label to the search input

This commit is contained in:
Ritesh Patil 2022-04-07 08:26:28 +00:00 коммит произвёл GitHub
Родитель de8c4fe098
Коммит ce5f599a4e
2 изменённых файлов: 10 добавлений и 2 удалений

Просмотреть файл

@ -218,7 +218,11 @@ export function Search({
<div className="position-relative z-2">
<form role="search" className="width-full d-flex" noValidate onSubmit={onFormSubmit}>
<label className="text-normal width-full">
<span className="visually-hidden">{t`placeholder`}</span>
<span
className="visually-hidden"
aria-label={t`label`}
aria-describedby={t`description`}
>{t`placeholder`}</span>
<input
data-testid="site-search-input"
ref={inputRef}
@ -244,6 +248,8 @@ export function Search({
maxLength={512}
onChange={onSearch}
value={localQuery}
aria-label={t`label`}
aria-describedby={t`description`}
/>
</label>
<button className="d-none" type="submit" title="Submit the search query." hidden />

Просмотреть файл

@ -34,13 +34,15 @@ release_notes:
banner_text: GitHub began rolling these changes out to enterprises on
search:
need_help: Need help?
placeholder: Search topics, products...
placeholder: Search GitHub Docs
loading: Loading
no_results: No results found
search_results_for: Search results for
no_content: No content
matches_displayed: Matches displayed
search_error: An error occurred trying to perform the search.
description: Enter a search term to find it in the GitHub Documentation.
label: Search GitHub Docs
homepage:
explore_by_product: Explore by product
version_picker: Version