[FIX] web: autofocus in autocomplete popup on a m2x field

* When the autocomplete popup list appears, the focus should be on first element in list, in order to quick create a new record if no match
* Tour.js has been modified because jquery ui autocomplete needs a mouseenter event to be notified that this element will be set
This commit is contained in:
Ravi Gadhia
2015-09-17 11:34:22 +02:00
committed by Martin Geubelle
parent 45995b57c0
commit 5bae0ce6f4
2 changed files with 2 additions and 0 deletions
+1
View File
@@ -699,6 +699,7 @@ var Tour = {
click_event("mouseover");
click_event("mousedown");
click_event("mouseup");
$element.trigger('mouseenter'); // click_event("mouseenter") doesn't work because jquery event handler register mouseenter as mouseover
click_event("click");
if ($element.is("input, textarea, select") && !$element.is(":focus")) {
$element.focus();
@@ -290,6 +290,7 @@ var FieldMany2One = common.AbstractField.extend(common.CompletionFieldMixin, com
focus: function(e, ui) {
e.preventDefault();
},
autoFocus: true,
html: true,
// disabled to solve a bug, but may cause others
//close: anyoneLoosesFocus,