[IMP] close search autocompletion list while completing

Looks slightly worse as results don't seamlessly update in-place, but
limits/avoids the risk of quick-typing, hitting [Return] and getting
an incomplete/incorrect query because the completion didn't catch up
(e.g. slow network) and [Return] validated the previously retrieved
completion.

lp bug: https://launchpad.net/bugs/1183746 fixed

bzr revid: xmo@openerp.com-20130605144949-jbzs2hppr6c1djg3
This commit is contained in:
Xavier Morel 2013-06-05 16:49:49 +02:00
parent 672933ebfe
commit d72773015e
1 changed files with 2 additions and 1 deletions

View File

@ -471,11 +471,12 @@ instance.web.SearchView = instance.web.Widget.extend(/** @lends instance.web.Sea
var autocomplete = this.$el.autocomplete({
source: this.proxy('complete_global_search'),
select: this.proxy('select_completion'),
search: function () { self.$el.autocomplete('close'); },
focus: function (e) { e.preventDefault(); },
html: true,
autoFocus: true,
minLength: 1,
delay: 0
delay: 0,
}).data('autocomplete');
// MonkeyPatch autocomplete instance