Skip to content

Commit

Permalink
Make search function properly with tab navigation (#700)
Browse files Browse the repository at this point in the history
Implemented for Rietveld. After that site has updated to the a ginger version including this commit, the workaround in commit 893baf8f00ea6d628e58a28779caab0b8ee13cc6.

Co-authored-by: Colin de Roos <colin@driebit.nl>
  • Loading branch information
cdfa and Colin de Roos committed Apr 13, 2022
1 parent d5976ff commit 48e1aa8
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion modules/mod_ginger_base/lib/js/search-suggestions.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@
this._closeSearch();
}
break;

case 'OnBlur': {
this._closeSearch();
}
break;
}
},

Expand Down Expand Up @@ -122,12 +127,16 @@

}

$(document).on('keyup', function(e) {
me.element.on('keyup', function(e) {
if (e.keyCode === 13) {
me.update('OnReturnPressed');
}
});

me.element.on('blur', function() {
me.update('OnBlur');
})

me.element.on('keyup', function(e) {
var key = e.keyCode;
var inputValue = e.currentTarget.value;
Expand Down

0 comments on commit 48e1aa8

Please sign in to comment.