fix(theme): improve local search input a11y (#4066)

Co-authored-by: Divyansh Singh <40380293+brc-dd@users.noreply.github.com>
pull/4274/head
Gunther Konig 1 month ago committed by GitHub
parent 461a5b001d
commit 92b92aefca
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -440,10 +440,20 @@ function formMarkRegex(terms: Set<string>) {
<input
ref="searchInput"
v-model="filterText"
:placeholder="buttonText"
id="localsearch-input"
:aria-activedescendant="selectedIndex > -1 ? ('localsearch-item-' + selectedIndex) : undefined"
aria-autocomplete="both"
:aria-controls="results?.length ? 'localsearch-list' : undefined"
aria-labelledby="localsearch-label"
autocapitalize="off"
autocomplete="off"
autocorrect="off"
class="search-input"
id="localsearch-input"
enterkeyhint="go"
maxlength="64"
:placeholder="buttonText"
spellcheck="false"
type="search"
/>
<div class="search-actions">
<button
@ -482,8 +492,9 @@ function formMarkRegex(terms: Set<string>) {
<li
v-for="(p, index) in results"
:key="p.id"
role="option"
:id="'localsearch-item-' + index"
:aria-selected="selectedIndex === index ? 'true' : 'false'"
role="option"
>
<a
:href="p.id"

Loading…
Cancel
Save