[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:
parent
e972b6a5d4
commit
70f8f99b35
|
@ -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, {
|
instance.web.form.FieldMany2One = instance.web.form.AbstractField.extend(instance.web.form.CompletionFieldMixin, instance.web.form.ReinitializeFieldMixin, {
|
||||||
template: "FieldMany2One",
|
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) {
|
init: function(field_manager, node) {
|
||||||
this._super(field_manager, node);
|
this._super(field_manager, node);
|
||||||
instance.web.form.CompletionFieldMixin.init.call(this);
|
instance.web.form.CompletionFieldMixin.init.call(this);
|
||||||
|
|
Loading…
Reference in New Issue