@@ -209,35 +209,38 @@ export function Search({
209209 < div data-testid = "search" aria-hidden = "true" >
210210 < div className = "position-relative z-2" >
211211 < form role = "search" className = "width-full d-flex" noValidate onSubmit = { onFormSubmit } >
212- < input
213- data-testid = "site-search-input"
214- ref = { inputRef }
215- className = { cx (
216- styles . searchInput ,
217- iconSize === 24 && 'form-control px-6 f4' ,
218- iconSize === 16 && 'form-control px-5 f4' ,
219- variant === 'compact' && 'py-2' ,
220- variant === 'expanded' && 'py-3' ,
221- isHeaderSearch && styles . searchInputHeader ,
222- ! isHeaderSearch && 'width-full' ,
223- isHeaderSearch && query && styles . searchInputExpanded ,
224- isHeaderSearch && query && 'position-absolute top-0 right-0'
225- ) }
226- style = { {
227- background : `var(--color-canvas-default) url("/assets/images/octicons/search-${ iconSize } .svg") no-repeat ${
228- iconSize === 24 ? '12px' : '6px'
229- } `,
230- } }
231- type = "search"
232- placeholder = { t `placeholder` }
233- autoComplete = "off"
234- autoCorrect = "off"
235- autoCapitalize = "off"
236- spellCheck = "false"
237- maxLength = { 512 }
238- onChange = { onSearch }
239- value = { localQuery }
240- />
212+ < label className = "text-normal width-full" >
213+ < span className = "visually-hidden" > { t `placeholder` } </ span >
214+ < input
215+ data-testid = "site-search-input"
216+ ref = { inputRef }
217+ className = { cx (
218+ styles . searchInput ,
219+ iconSize === 24 && 'form-control px-6 f4' ,
220+ iconSize === 16 && 'form-control px-5 f4' ,
221+ variant === 'compact' && 'py-2' ,
222+ variant === 'expanded' && 'py-3' ,
223+ isHeaderSearch && styles . searchInputHeader ,
224+ ! isHeaderSearch && 'width-full' ,
225+ isHeaderSearch && query && styles . searchInputExpanded ,
226+ isHeaderSearch && query && 'position-absolute top-0 right-0'
227+ ) }
228+ style = { {
229+ background : `var(--color-canvas-default) url("/assets/images/octicons/search-${ iconSize } .svg") no-repeat ${
230+ iconSize === 24 ? '12px' : '6px'
231+ } `,
232+ } }
233+ type = "search"
234+ placeholder = { t `placeholder` }
235+ autoComplete = "off"
236+ autoCorrect = "off"
237+ autoCapitalize = "off"
238+ spellCheck = "false"
239+ maxLength = { 512 }
240+ onChange = { onSearch }
241+ value = { localQuery }
242+ />
243+ </ label >
241244 < button className = "d-none" type = "submit" title = "Submit the search query." hidden />
242245 </ form >
243246 </ div >
0 commit comments