mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-02 06:39:32 +02:00
fix(shortcut): Address PR review feedback
- Use `target.isContentEditable` instead of `[contenteditable="true"]` selector to properly detect all contenteditable elements - Use `CSS.escape()` for keyboard shortcut key to handle special characters - Rename scoped CSS class to `.repo-file-search-shortcut-hint` to avoid conflict with global `.repo-search-shortcut-hint` styles
This commit is contained in:
@@ -154,7 +154,7 @@ watch([searchQuery, filteredFiles], async () => {
|
||||
@input="handleSearchInput" @keydown="handleKeyDown"
|
||||
@focus="isInputFocused = true" @blur="isInputFocused = false"
|
||||
>
|
||||
<kbd v-show="!searchQuery && !isInputFocused" class="repo-search-shortcut-hint">T</kbd>
|
||||
<kbd v-show="!searchQuery && !isInputFocused" class="repo-file-search-shortcut-hint">T</kbd>
|
||||
</div>
|
||||
|
||||
<Teleport to="body">
|
||||
@@ -202,7 +202,7 @@ watch([searchQuery, filteredFiles], async () => {
|
||||
border-color: var(--color-primary) !important;
|
||||
}
|
||||
|
||||
.repo-search-shortcut-hint {
|
||||
.repo-file-search-shortcut-hint {
|
||||
position: absolute;
|
||||
right: 10px;
|
||||
top: 50%;
|
||||
@@ -219,7 +219,7 @@ watch([searchQuery, filteredFiles], async () => {
|
||||
}
|
||||
|
||||
/* Hide kbd when input is focused so it doesn't interfere with focus border */
|
||||
.repo-file-search-input-wrapper input:focus + .repo-search-shortcut-hint {
|
||||
.repo-file-search-input-wrapper input:focus + .repo-file-search-shortcut-hint {
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user