From 70f8f99b35c93a880cf15a1f21b7f88aef5a8d36 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Mon, 10 Dec 2012 12:22:03 +0100 Subject: [PATCH] [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 --- addons/web/static/src/js/view_form.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 6f7582ab2ad..814995da5f7 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -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);