diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2023-08-26 10:44:00 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-26 10:44:00 +0800 |
commit | 4fdb09de588fb1ff32184411df80d5d59333b94c (patch) | |
tree | 5fb304d5be73ce7a4e6e0f29b95a7b91b13730d1 /web_src | |
parent | 576644d81555cfcd7c865d444285cad64cc0b9ec (diff) | |
download | gitea-4fdb09de588fb1ff32184411df80d5d59333b94c.tar.gz gitea-4fdb09de588fb1ff32184411df80d5d59333b94c.zip |
Fix incorrect "tabindex" attributes (#26733)
Fix #26731
Almost all "tabindex" in code are incorrect.
1. All "input/button" by default are focusable, so no need to use "tabindex=0"
2. All "div/span" by default are not focusable, so no need to use "tabindex=-1"
3. All "dropdown" are focusable by framework, so no need to use "tabindex"
4. Some tabindex values are incorrect (eg: `new_form.tmpl`), so remove them
Co-authored-by: Giteabot <teabot@gitea.io>
Diffstat (limited to 'web_src')
-rw-r--r-- | web_src/js/components/DiffCommitSelector.vue | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/web_src/js/components/DiffCommitSelector.vue b/web_src/js/components/DiffCommitSelector.vue index e24619dc08..283ef03ab9 100644 --- a/web_src/js/components/DiffCommitSelector.vue +++ b/web_src/js/components/DiffCommitSelector.vue @@ -6,7 +6,6 @@ @click.stop="toggleMenu()" :data-tooltip-content="locale.filter_changes_by_commit" aria-haspopup="true" - tabindex="0" aria-controls="diff-commit-selector-menu" :aria-label="locale.filter_changes_by_commit" aria-activedescendant="diff-commit-list-show-all" @@ -15,7 +14,7 @@ </button> <div class="menu left transition" id="diff-commit-selector-menu" :class="{visible: menuVisible}" v-show="menuVisible" v-cloak :aria-expanded="menuVisible ? 'true': 'false'"> <div class="loading-indicator is-loading" v-if="isLoading"/> - <div v-if="!isLoading" class="vertical item gt-df gt-fc gt-gap-2" id="diff-commit-list-show-all" role="menuitem" tabindex="-1" @keydown.enter="showAllChanges()" @click="showAllChanges()"> + <div v-if="!isLoading" class="vertical item gt-df gt-fc gt-gap-2" id="diff-commit-list-show-all" role="menuitem" @keydown.enter="showAllChanges()" @click="showAllChanges()"> <div class="gt-ellipsis"> {{ locale.show_all_commits }} </div> @@ -25,7 +24,7 @@ </div> <!-- only show the show changes since last review if there is a review AND we are commits ahead of the last review --> <div - v-if="lastReviewCommitSha != null" role="menuitem" tabindex="-1" + v-if="lastReviewCommitSha != null" role="menuitem" class="vertical item gt-df gt-fc gt-gap-2 gt-border-secondary-top" :class="{disabled: commitsSinceLastReview === 0}" @keydown.enter="changesSinceLastReviewClick()" @@ -41,7 +40,7 @@ <span v-if="!isLoading" class="info gt-border-secondary-top text light-2">{{ locale.select_commit_hold_shift_for_range }}</span> <template v-for="commit in commits" :key="commit.id"> <div - class="vertical item gt-df gt-gap-2 gt-border-secondary-top" role="menuitem" tabindex="-1" + class="vertical item gt-df gt-gap-2 gt-border-secondary-top" role="menuitem" :class="{selection: commit.selected, hovered: commit.hovered}" @keydown.enter.exact="commitClicked(commit.id)" @keydown.enter.shift.exact="commitClickedShift(commit)" |