File tree Expand file tree Collapse file tree 2 files changed +17
-4
lines changed Expand file tree Collapse file tree 2 files changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -218,7 +218,11 @@ export function Search({
218
218
< div className = "position-relative z-2" >
219
219
< form role = "search" className = "width-full d-flex" noValidate onSubmit = { onFormSubmit } >
220
220
< label className = "text-normal width-full" >
221
- < span className = "visually-hidden" > { t `placeholder` } </ span >
221
+ < span
222
+ className = "visually-hidden"
223
+ aria-label = { t `label` }
224
+ aria-describedby = { t `description` }
225
+ > { t `placeholder` } </ span >
222
226
< input
223
227
data-testid = "site-search-input"
224
228
ref = { inputRef }
@@ -237,13 +241,15 @@ export function Search({
237
241
) }
238
242
type = "search"
239
243
placeholder = { t `placeholder` }
240
- autoComplete = " off"
244
+ autoComplete = { localQuery ? 'on' : ' off' }
241
245
autoCorrect = "off"
242
246
autoCapitalize = "off"
243
247
spellCheck = "false"
244
248
maxLength = { 512 }
245
249
onChange = { onSearch }
246
250
value = { localQuery }
251
+ aria-label = { t `label` }
252
+ aria-describedby = { t `description` }
247
253
/>
248
254
</ label >
249
255
< button className = "d-none" type = "submit" title = "Submit the search query." hidden />
@@ -393,7 +399,12 @@ function ShowSearchResults({
393
399
You're searching the < strong > { searchVersion } </ strong > version.
394
400
</ p >
395
401
< div className = "float-right mr-4" >
396
- < p className = { cx ( styles . selectWording , 'f6 d-inline-block' ) } > Select version:</ p >
402
+ < p
403
+ aria-describedby = { `You're searching the ${ searchVersion } version` }
404
+ className = { cx ( styles . selectWording , 'f6 d-inline-block' ) }
405
+ >
406
+ Select version:
407
+ </ p >
397
408
< DropdownMenu
398
409
placeholder = { searchVersion }
399
410
items = { searchVersions }
Original file line number Diff line number Diff line change @@ -34,13 +34,15 @@ release_notes:
34
34
banner_text : GitHub began rolling these changes out to enterprises on
35
35
search :
36
36
need_help : Need help?
37
- placeholder : Search topics, products...
37
+ placeholder : Search GitHub Docs
38
38
loading : Loading
39
39
no_results : No results found
40
40
search_results_for : Search results for
41
41
no_content : No content
42
42
matches_displayed : Matches displayed
43
43
search_error : An error occurred trying to perform the search.
44
+ description : Enter a search term to find it in the GitHub Documentation.
45
+ label : Search GitHub Docs
44
46
homepage :
45
47
explore_by_product : Explore by product
46
48
version_picker : Version
You can’t perform that action at this time.
0 commit comments