Skip to content

Commit 9780da5

Browse files
GiteaBotwxiaoguang
andauthored
Fix issue sidebar dropdown keyboard support (#33447) (#33450)
Backport #33447 by wxiaoguang Just a quick fix, fix #33444 Co-authored-by: wxiaoguang <[email protected]>
1 parent a8eaf43 commit 9780da5

File tree

5 files changed

+12
-6
lines changed

5 files changed

+12
-6
lines changed

templates/repo/issue/sidebar/assignee_list.tmpl

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@
1515
<i class="icon">{{svg "octicon-search" 16}}</i>
1616
<input type="text" placeholder="{{ctx.Locale.Tr "repo.issues.filter_assignees"}}">
1717
</div>
18-
<div class="item clear-selection">{{ctx.Locale.Tr "repo.issues.new.clear_assignees"}}</div>
1918
<div class="scrolling menu flex-items-block">
19+
<div class="item clear-selection">{{ctx.Locale.Tr "repo.issues.new.clear_assignees"}}</div>
20+
<div class="divider"></div>
2021
{{range $data.CandidateAssignees}}
2122
<a class="item" href="#" data-value="{{.ID}}">
2223
<span class="item-check-mark">{{svg "octicon-check"}}</span>

templates/repo/issue/sidebar/label_list.tmpl

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@
1616
<i class="icon">{{svg "octicon-search" 16}}</i>
1717
<input type="text" placeholder="{{ctx.Locale.Tr "repo.issues.filter_labels"}}">
1818
</div>
19-
<a class="item clear-selection" href="#">{{ctx.Locale.Tr "repo.issues.new.clear_labels"}}</a>
2019
<div class="scrolling menu">
20+
<a class="item clear-selection" href="#">{{ctx.Locale.Tr "repo.issues.new.clear_labels"}}</a>
21+
<div class="divider"></div>
2122
{{$previousExclusiveScope := "_no_scope"}}
2223
{{range $data.RepoLabels}}
2324
{{$exclusiveScope := .ExclusiveScope}}

templates/repo/issue/sidebar/milestone_list.tmpl

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
<i class="icon">{{svg "octicon-search"}}</i>
1919
<input type="text" placeholder="{{ctx.Locale.Tr "repo.issues.filter_milestones"}}">
2020
</div>
21-
<div class="divider"></div>
22-
<div class="item clear-selection">{{ctx.Locale.Tr "repo.issues.new.clear_milestone"}}</div>
2321
<div class="scrolling menu">
22+
<div class="item clear-selection">{{ctx.Locale.Tr "repo.issues.new.clear_milestone"}}</div>
23+
<div class="divider"></div>
2424
{{if $data.OpenMilestones}}
2525
<div class="header">{{ctx.Locale.Tr "repo.issues.filter_milestone_open"}}</div>
2626
{{range $data.OpenMilestones}}

templates/repo/issue/sidebar/project_list.tmpl

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@
1717
<input type="text" placeholder="{{ctx.Locale.Tr "repo.issues.filter_projects"}}">
1818
</div>
1919
{{end}}
20-
<div class="item clear-selection">{{ctx.Locale.Tr "repo.issues.new.clear_projects"}}</div>
2120
<div class="scrolling menu">
21+
<div class="item clear-selection">{{ctx.Locale.Tr "repo.issues.new.clear_projects"}}</div>
22+
<div class="divider"></div>
2223
{{if $data.OpenProjects}}
2324
<div class="header">{{ctx.Locale.Tr "repo.issues.new.open_projects"}}</div>
2425
{{range $data.OpenProjects}}

web_src/js/features/repo-issue-sidebar.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,13 @@ A sidebar combo (dropdown+list) is like this:
2222
When the selected items change, the `combo-value` input will be updated.
2323
If there is `data-update-url`, it also calls backend to attach/detach the changed items.
2424

25-
Also, the changed items will be syncronized to the `ui list` items.
25+
Also, the changed items will be synchronized to the `ui list` items.
2626

2727
The items with the same data-scope only allow one selected at a time.
2828

2929
The dropdown selection could work in 2 modes:
3030
* single: only one item could be selected, it updates immediately when the item is selected.
3131
* multiple: multiple items could be selected, it defers the update until the dropdown is hidden.
32+
33+
When using "scrolling menu", the items must be in the same level,
34+
otherwise keyboard (ArrowUp/ArrowDown/Enter) won't work.

0 commit comments

Comments
 (0)