Skip to content

Commit bbfeffc

Browse files
authored
Merge pull request #347 from codesnippetspro/a11y-search
Fix: add semantics to snippets search box
2 parents 7da41fc + 0b7fc66 commit bbfeffc

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

src/js/components/ManageMenu/SnippetsTable/SnippetsListTable.tsx

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -204,17 +204,19 @@ const SearchBox = () => {
204204
const { searchQuery, setSearchQuery } = useSnippetsFilters()
205205

206206
return (
207-
<p className="search-box">
208-
<label className="screen-reader-text" htmlFor="snippets_search">{__('Search Snippets:', 'code-snippets')}</label>
209-
<input
210-
type="search"
211-
id="snippets_search"
212-
name="s"
213-
value={searchQuery ?? ''}
214-
onChange={event => setSearchQuery(event.target.value)}
215-
placeholder={__('Search snippets', 'code-snippets')}
216-
/>
217-
</p>
207+
<search aria-label={__('Search Snippets', 'code-snippets')}>
208+
<p className="search-box">
209+
<label className="screen-reader-text" htmlFor="snippets_search">{__('Search Snippets:', 'code-snippets')}</label>
210+
<input
211+
type="search"
212+
id="snippets_search"
213+
name="s"
214+
value={searchQuery ?? ''}
215+
onChange={event => setSearchQuery(event.target.value)}
216+
placeholder={__('Search snippets', 'code-snippets')}
217+
/>
218+
</p>
219+
</search>
218220
)
219221
}
220222

0 commit comments

Comments
 (0)