From b09a121bd0941ff2789036295b5c3f420fff0e30 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Thu, 26 Jul 2012 13:31:05 +0200 Subject: [PATCH] [IMP] clear out internal autocomplete cache of searchview on blur ensures consecutive searches of the same element will behave correctly (trigger a new autocompletion instead of nooping the second time around because the new value is the same as the old/stored one) bzr revid: xmo@openerp.com-20120726113105-d73fere31qdy8wda --- addons/web/static/src/js/search.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/addons/web/static/src/js/search.js b/addons/web/static/src/js/search.js index 8ffd672c143..2cd88811b72 100644 --- a/addons/web/static/src/js/search.js +++ b/addons/web/static/src/js/search.js @@ -516,6 +516,14 @@ instance.web.SearchView = instance.web.Widget.extend(/** @lends instance.web.Sea this.$element.addClass('oe_focused'); }, childBlurred: function () { + var val = this.$element.val(); + this.$element.val(''); + var complete = this.$element.data('autocomplete'); + if ((val && complete.term === undefined) || complete.previous !== undefined) { + throw new Error("new jquery.ui version altering implementation" + + " details relied on"); + } + delete complete.term; this.$element.removeClass('oe_focused'); }, /**