From a1bfa84f65a72fb1ff50e00e2cc4792e9d9bf4d1 Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Sat, 25 Apr 2015 18:05:09 +0200 Subject: [PATCH] [FIX] web: get right result for arrow suggestions In the search input, the result of filtered search with an arrow was placed under the currently selected arrow. Hence if we get to another arrow filter before the result is received, the result is added under the wrong arrow. This fix adds the result under the right arrow. closes #6442 opw-632519 --- addons/web/static/src/js/search.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/addons/web/static/src/js/search.js b/addons/web/static/src/js/search.js index 701f81d335a..8b82ed0cbd2 100644 --- a/addons/web/static/src/js/search.js +++ b/addons/web/static/src/js/search.js @@ -2502,14 +2502,15 @@ instance.web.search.AutoComplete = instance.web.Widget.extend({ }, expand: function () { var self = this; - this.current_result.expand(this.get_search_string()).then(function (results) { + var current_result = this.current_result; + current_result.expand(this.get_search_string()).then(function (results) { (results || [{label: '(no result)'}]).reverse().forEach(function (result) { result.indent = true; var $li = self.make_list_item(result); - self.current_result.$el.after($li); + current_result.$el.after($li); }); - self.current_result.expanded = true; - self.current_result.$el.find('span.oe-expand').html('▼'); + current_result.expanded = true; + current_result.$el.find('span.oe-expand').html('▼'); }); }, fold: function () {