File tree 3 files changed +11
-9
lines changed
templates/repo/issue/view_content
3 files changed +11
-9
lines changed Original file line number Diff line number Diff line change 121
121
<input type="text" placeholder="{{.locale.Tr "repo.issues.filter_labels"}}">
122
122
</div>
123
123
{{end}}
124
- <div class="no-select item">{{.locale.Tr "repo.issues.new.clear_labels"}}</div >
124
+ <a class="no-select item" href="#" >{{.locale.Tr "repo.issues.new.clear_labels"}}</a >
125
125
{{if or .Labels .OrgLabels}}
126
126
{{$previousExclusiveScope := "_no_scope"}}
127
127
{{range .Labels}}
Original file line number Diff line number Diff line change @@ -81,7 +81,8 @@ function attachOneDropdownAria($dropdown) {
81
81
$dropdown . on ( 'keydown' , ( e ) => {
82
82
// here it must use keydown event before dropdown's keyup handler, otherwise there is no Enter event in our keyup handler
83
83
if ( e . key === 'Enter' ) {
84
- const $item = $dropdown . dropdown ( 'get item' , $dropdown . dropdown ( 'get value' ) ) ;
84
+ let $item = $dropdown . dropdown ( 'get item' , $dropdown . dropdown ( 'get value' ) ) ;
85
+ if ( ! $item ) $item = $menu . find ( '> .item.selected' ) ; // when dropdown filters items by input, there is no "value", so query the "selected" item
85
86
// if the selected item is clickable, then trigger the click event. in the future there could be a special CSS class for it.
86
87
if ( $item && $item . is ( 'a' ) ) $item [ 0 ] . click ( ) ;
87
88
}
Original file line number Diff line number Diff line change @@ -86,11 +86,12 @@ export function initRepoCommentForm() {
86
86
let hasUpdateAction = $listMenu . data ( 'action' ) === 'update' ;
87
87
const items = { } ;
88
88
89
- $ ( `.${ selector } ` ) . dropdown ( 'setting' , 'onHide' , ( ) => {
90
- hasUpdateAction = $listMenu . data ( 'action' ) === 'update' ; // Update the var
91
- if ( hasUpdateAction ) {
92
- // TODO: Add batch functionality and make this 1 network request.
93
- ( async function ( ) {
89
+ $ ( `.${ selector } ` ) . dropdown ( {
90
+ 'action' : 'nothing' , // do not hide the menu if user presses Enter
91
+ async onHide ( ) {
92
+ hasUpdateAction = $listMenu . data ( 'action' ) === 'update' ; // Update the var
93
+ if ( hasUpdateAction ) {
94
+ // TODO: Add batch functionality and make this 1 network request.
94
95
for ( const [ elementId , item ] of Object . entries ( items ) ) {
95
96
await updateIssuesMeta (
96
97
item [ 'update-url' ] ,
@@ -100,8 +101,8 @@ export function initRepoCommentForm() {
100
101
) ;
101
102
}
102
103
window . location . reload ( ) ;
103
- } ) ( ) ;
104
- }
104
+ }
105
+ } ,
105
106
} ) ;
106
107
107
108
$listMenu . find ( '.item:not(.no-select)' ) . on ( 'click' , function ( e ) {
You can’t perform that action at this time.
0 commit comments