diff --git a/app/views/layouts/base.html.erb b/app/views/layouts/base.html.erb index 1ed1032e9..42819c1fb 100644 --- a/app/views/layouts/base.html.erb +++ b/app/views/layouts/base.html.erb @@ -80,7 +80,11 @@ - <%= text_field_tag 'q', @question, :size => 20, :class => 'small', :accesskey => accesskey(:quick_search) %> + <%= text_field_tag 'q', @question, :size => 20, :class => 'small', :accesskey => accesskey(:quick_search), + :data => { + :auto_complete => true, + :issues_url => auto_complete_issues_path(:q => '') + } %> <% end %> <%= render_project_jump_box %> diff --git a/app/views/search/index.html.erb b/app/views/search/index.html.erb index ab11f5a49..5160f04fe 100644 --- a/app/views/search/index.html.erb +++ b/app/views/search/index.html.erb @@ -3,7 +3,11 @@ <%= form_tag({}, :method => :get, :id => 'search-form') do %>
<%= label_tag "search-input", l(:description_search), :class => "hidden-for-sighted" %> -

<%= text_field_tag 'q', @question, :size => 60, :id => 'search-input' %> +

<%= text_field_tag 'q', @question, :size => 60, :id => 'search-input', + :data => { + :auto_complete => true, + :issues_url => auto_complete_issues_path(:q => '') + } %> <%= project_select_tag %> <%= hidden_field_tag 'all_words', '', :id => nil %> diff --git a/public/javascripts/application.js b/public/javascripts/application.js index 0868f971a..e125e68b4 100644 --- a/public/javascripts/application.js +++ b/public/javascripts/application.js @@ -1036,6 +1036,9 @@ function inlineAutoComplete(element) { const tribute = new Tribute({ trigger: '#', values: function (text, cb) { + if (event.target.type === 'text' && $(element).attr('autocomplete') != 'off') { + $(element).attr('autocomplete', 'off'); + } remoteSearch(issuesUrl + text, function (issues) { return cb(issues); });