mirror of
https://github.com/go-gitea/gitea.git
synced 2026-09-25 16:18:32 +02:00
refactor(shortcut): Use declarative data attributes for keyboard shortcuts
Instead of having JavaScript code guess which elements exist on a page, elements now declare their keyboard shortcuts via data-global-keyboard-shortcut attribute. This makes it easier to add new shortcuts and follows Gitea's existing patterns for data-global-init and data-global-click.
This commit is contained in:
@@ -150,6 +150,7 @@ watch([searchQuery, filteredFiles], async () => {
|
||||
<input
|
||||
ref="searchInput" :placeholder="placeholder" autocomplete="off"
|
||||
role="combobox" aria-autocomplete="list" :aria-expanded="searchQuery ? 'true' : 'false'"
|
||||
data-global-keyboard-shortcut="t"
|
||||
@input="handleSearchInput" @keydown="handleKeyDown"
|
||||
@focus="isInputFocused = true" @blur="isInputFocused = false"
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user