File tree Expand file tree Collapse file tree
templates/repo/issue/view_content Expand file tree Collapse file tree Original file line number Diff line number Diff line change 121121 <input type= " text" placeholder= " {{.locale.Tr " repo.issues.filter_labels " }}" >
122122 </div>
123123 {{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 >
125125 {{if or .Labels .OrgLabels }}
126126 {{$previousExclusiveScope := " _no_scope" }}
127127 {{range .Labels }}
Original file line number Diff line number Diff line change @@ -81,7 +81,8 @@ function attachOneDropdownAria($dropdown) {
8181 $dropdown . on ( 'keydown' , ( e ) => {
8282 // here it must use keydown event before dropdown's keyup handler, otherwise there is no Enter event in our keyup handler
8383 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
8586 // if the selected item is clickable, then trigger the click event. in the future there could be a special CSS class for it.
8687 if ( $item && $item . is ( 'a' ) ) $item [ 0 ] . click ( ) ;
8788 }
Original file line number Diff line number Diff line change @@ -86,11 +86,12 @@ export function initRepoCommentForm() {
8686 let hasUpdateAction = $listMenu . data ( 'action' ) === 'update' ;
8787 const items = { } ;
8888
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.
9495 for ( const [ elementId , item ] of Object . entries ( items ) ) {
9596 await updateIssuesMeta (
9697 item [ 'update-url' ] ,
@@ -100,8 +101,8 @@ export function initRepoCommentForm() {
100101 ) ;
101102 }
102103 window . location . reload ( ) ;
103- } ) ( ) ;
104- }
104+ }
105+ } ,
105106 } ) ;
106107
107108 $listMenu . find ( '.item:not(.no-select)' ) . on ( 'click' , function ( e ) {
You can’t perform that action at this time.
0 commit comments