Commit ca19bf6a638809a75400f6da8fe0d3d4002d8975
1 parent
118b8590
Exists in
master
and in
29 other branches
[search-improvements] Submit search when autocomplete option is selected
Showing
1 changed file
with
4 additions
and
0 deletions
Show diff stats
public/javascripts/application.js
... | ... | @@ -1107,6 +1107,10 @@ jQuery(document).ready(function(){ |
1107 | 1107 | var suggestions_cache = {}; |
1108 | 1108 | $("#search-input").autocomplete({ |
1109 | 1109 | minLength: 2, |
1110 | + select: function(event, ui){ | |
1111 | + $(this).val(ui.item.value); | |
1112 | + $(this).closest('form').submit(); | |
1113 | + }, | |
1110 | 1114 | source: function(request, response) { |
1111 | 1115 | var term = request.term; |
1112 | 1116 | if (term in suggestions_cache) { | ... | ... |