From 4ab85f2fb33758a70f6bdcb4885634ad2b6059ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9ry=20Debongnie?= Date: Tue, 1 Jul 2014 09:39:26 +0200 Subject: [PATCH] [FIX] prevent an incorrect state in autocompletion When going up and wrapping around, the focus was on a hidden separator, so hitting enter = stacktrace. Now, the focus goes on the last selectable list item.- --- addons/web/static/src/js/search.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web/static/src/js/search.js b/addons/web/static/src/js/search.js index 4b00f6f4e01..1bfdc86fb5a 100644 --- a/addons/web/static/src/js/search.js +++ b/addons/web/static/src/js/search.js @@ -2505,7 +2505,7 @@ instance.web.search.AutoComplete = instance.web.Widget.extend({ if (!$next.length) $next = this.$('li:first-child'); } else { $next = this.$('li.oe-selection-focus').prevAll(':not(.oe-separator)').first(); - if (!$next.length) $next = this.$('li:last-child'); + if (!$next.length) $next = this.$('li:not(.oe-separator)').last(); } this.focus_element($next); },