mirror of
https://github.com/discourse/discourse.git
synced 2024-11-28 00:54:21 +08:00
FIX: Remove up/down key bindings for search results
Up/down key bindings make it difficult to access Show More on search results. https://meta.discourse.org/t/keyboard-users-cant-select-show-more-in-search-results/19394
This commit is contained in:
parent
1acb2a13f1
commit
3e7084743c
|
@ -2,28 +2,28 @@ export default Discourse.View.extend({
|
|||
tagName: 'div',
|
||||
classNames: ['d-dropdown'],
|
||||
elementId: 'search-dropdown',
|
||||
templateName: 'search',
|
||||
templateName: 'search'
|
||||
|
||||
didInsertElement: function() {
|
||||
// Delegate ESC to the composer
|
||||
var controller = this.get('controller');
|
||||
return $('body').on('keydown.search', function(e) {
|
||||
if ($('#search-dropdown').is(':visible')) {
|
||||
switch (e.which) {
|
||||
case 13:
|
||||
controller.select();
|
||||
e.preventDefault();
|
||||
break;
|
||||
case 38:
|
||||
controller.moveUp();
|
||||
e.preventDefault();
|
||||
break;
|
||||
case 40:
|
||||
controller.moveDown();
|
||||
e.preventDefault();
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
// didInsertElement: function() {
|
||||
// // Delegate ESC to the composer
|
||||
// var controller = this.get('controller');
|
||||
// return $('body').on('keydown.search', function(e) {
|
||||
// if ($('#search-dropdown').is(':visible')) {
|
||||
// switch (e.which) {
|
||||
// case 13:
|
||||
// controller.select();
|
||||
// e.preventDefault();
|
||||
// break;
|
||||
// case 38:
|
||||
// controller.moveUp();
|
||||
// e.preventDefault();
|
||||
// break;
|
||||
// case 40:
|
||||
// controller.moveDown();
|
||||
// e.preventDefault();
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue
Block a user