[FIX] prevent propagation of [UP] and [DOWN] keydown events in form m2o

these events are used by the autocompletion widget internally, if they
bubble upwards they also get handled by the list view which interprets
them as going up/down the list.

Prevent the latter by suppressing bubbling of these events.

bzr revid: xmo@openerp.com-20121210112203-3mry0pvecri0pv9o
This commit is contained in:
Xavier Morel 2012-12-10 12:22:03 +01:00
parent e972b6a5d4
commit 70f8f99b35
1 changed files with 9 additions and 0 deletions

View File

@ -2910,6 +2910,15 @@ instance.web.form.M2ODialog = instance.web.Dialog.extend({
instance.web.form.FieldMany2One = instance.web.form.AbstractField.extend(instance.web.form.CompletionFieldMixin, instance.web.form.ReinitializeFieldMixin, {
template: "FieldMany2One",
events: {
'keydown input': function (e) {
switch (e.which) {
case $.ui.keyCode.UP:
case $.ui.keyCode.DOWN:
e.stopPropagation();
}
}
},
init: function(field_manager, node) {
this._super(field_manager, node);
instance.web.form.CompletionFieldMixin.init.call(this);