1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-23 10:48:37 +00:00

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>
This commit is contained in:
wxiaoguang
2023-08-26 10:44:00 +08:00
committed by GitHub
parent 576644d815
commit 4fdb09de58
11 changed files with 54 additions and 55 deletions

View File

@@ -11,7 +11,7 @@
{{ctx.AvatarUtils.Avatar .SignedUser 40}}
<div class="ui segment content gt-my-0">
<div class="field">
<input name="title" id="issue_title" placeholder="{{.locale.Tr "repo.milestones.title"}}" value="{{if .TitleQuery}}{{.TitleQuery}}{{else if .IssueTemplateTitle}}{{.IssueTemplateTitle}}{{else}}{{.title}}{{end}}" tabindex="3" autofocus required maxlength="255" autocomplete="off">
<input name="title" id="issue_title" placeholder="{{.locale.Tr "repo.milestones.title"}}" value="{{if .TitleQuery}}{{.TitleQuery}}{{else if .IssueTemplateTitle}}{{.IssueTemplateTitle}}{{else}}{{.title}}{{end}}" autofocus required maxlength="255" autocomplete="off">
{{if .PageIsComparePull}}
<div class="title_wip_desc" data-wip-prefixes="{{JsonUtils.EncodeToString .PullRequestWorkInProgressPrefixes}}">{{.locale.Tr "repo.pulls.title_wip_desc" (index .PullRequestWorkInProgressPrefixes 0| Escape) | Safe}}</div>
{{end}}
@@ -35,7 +35,7 @@
{{template "repo/issue/comment_tab" .}}
{{end}}
<div class="text right">
<button class="ui green button" tabindex="6">
<button class="ui green button">
{{if .PageIsComparePull}}
{{.locale.Tr "repo.pulls.create"}}
{{else}}

View File

@@ -621,7 +621,7 @@
</div>
<div class="field">
<div class="ui fluid dropdown selection" tabindex="0">
<div class="ui fluid dropdown selection">
<select name="reason">
<option value=""> </option>