Skip to content

Commit 7f4493d

Browse files
committed
feat(aria): add aria-keyshortcuts for file and repo search shortcuts
1 parent f1149a6 commit 7f4493d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

templates/repo/home_sidebar_top.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<div class="repo-home-sidebar-top">
22
<form class="ignore-dirty tw-flex tw-flex-1" action="{{.RepoLink}}/search" method="get">
33
<div class="ui small action input tw-flex-1 repo-code-search-input-wrapper">
4-
<input name="q" size="10" placeholder="{{ctx.Locale.Tr "search.code_kind"}}" class="code-search-input" data-global-keyboard-shortcut="s" data-global-init="initRepoCodeSearchShortcut">
5-
<kbd class="repo-search-shortcut-hint">S</kbd>
4+
<input name="q" size="10" placeholder="{{ctx.Locale.Tr "search.code_kind"}}" class="code-search-input" data-global-keyboard-shortcut="s" data-global-init="initRepoCodeSearchShortcut" aria-keyshortcuts="s">
5+
<kbd class="repo-search-shortcut-hint" aria-hidden="true">S</kbd>
66
{{template "shared/search/button"}}
77
</div>
88
</form>

web_src/js/components/RepoFileSearch.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,11 +148,11 @@ watch([searchQuery, filteredFiles], async () => {
148148
<input
149149
ref="searchInput" :placeholder="placeholder" autocomplete="off"
150150
role="combobox" aria-autocomplete="list" :aria-expanded="searchQuery ? 'true' : 'false'"
151-
data-global-keyboard-shortcut="t"
151+
data-global-keyboard-shortcut="t" aria-keyshortcuts="t"
152152
@input="handleSearchInput" @keydown="handleKeyDown"
153153
@focus="isInputFocused = true" @blur="isInputFocused = false"
154154
>
155-
<kbd v-show="!searchQuery && !isInputFocused" class="repo-file-search-shortcut-hint">T</kbd>
155+
<kbd v-show="!searchQuery && !isInputFocused" class="repo-file-search-shortcut-hint" aria-hidden="true">T</kbd>
156156
</div>
157157

158158
<Teleport to="body">

0 commit comments

Comments
 (0)