[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.-
This commit is contained in:
Géry Debongnie 2014-07-01 09:39:26 +02:00
parent 9132b1d306
commit 4ab85f2fb3
1 changed files with 1 additions and 1 deletions

View File

@ -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);
},