From 9d820ef4cc55abfecda41f3db61d8d5881e182bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 20 Jun 2019 23:15:06 +0200 Subject: [PATCH] Do not bind twice keydown event on key_press method The event is already binded in the Form widget so the EditableTree widget does not need to bind it again otherwise the callback is called twice per event. issue8429 review255571002 --- src/view/tree.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/view/tree.js b/src/view/tree.js index 1f8e26e436..7c14fd3e72 100644 --- a/src/view/tree.js +++ b/src/view/tree.js @@ -2154,7 +2154,6 @@ init: function(view, attributes) { Sao.View.EditableTree.Many2One._super.init.call( this, view, attributes); - this.el.on('keydown', this.key_press.bind(this)); }, key_press: function(event_) { if (event_.which == Sao.common.TAB_KEYCODE) { @@ -2171,7 +2170,6 @@ init: function(view, attributes) { Sao.View.EditableTree.Reference._super.init.call( this, view, attributes); - this.el.on('keydown', this.key_press.bind(this)); }, key_press: function(event_) { if (event_.which == Sao.common.TAB_KEYCODE) { @@ -2188,7 +2186,6 @@ init: function(view, attributes) { Sao.View.EditableTree.One2One._super.init.call( this, view, attributes); - this.el.on('keydown', this.key_press.bind(this)); }, key_press: function(event_) { if (event_.which == Sao.common.TAB_KEYCODE) {