summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js
diff options
context:
space:
mode:
authorAaron Bohy <aab@odoo.com>2017-09-26 13:55:13 +0200
committerAaron Bohy <aab@odoo.com>2017-09-27 12:13:58 +0200
commit2d3e5711f1229c4be52e3f8553feb734fc3d1a44 (patch)
tree25efdfbc6d45d866694425d09df489171b08f3e0 /addons/web/static/src/js
parentdf04910d2af088a8bb2bd0ea9080494124b1753c (diff)
[FIX] web: escape pressed in editable list in dialog
should discard the edited row, but not close the dialog. Before this rev., it was closing the dialog.
Diffstat (limited to 'addons/web/static/src/js')
-rw-r--r--addons/web/static/src/js/fields/abstract_field.js2
-rw-r--r--addons/web/static/src/js/views/list/list_editable_renderer.js3
2 files changed, 4 insertions, 1 deletions
diff --git a/addons/web/static/src/js/fields/abstract_field.js b/addons/web/static/src/js/fields/abstract_field.js
index 9b484354544..25aa9fceda9 100644
--- a/addons/web/static/src/js/fields/abstract_field.js
+++ b/addons/web/static/src/js/fields/abstract_field.js
@@ -444,7 +444,7 @@ var AbstractField = Widget.extend({
this.trigger_up('navigation_move', {direction: 'next_line'});
break;
case $.ui.keyCode.ESCAPE:
- this.trigger_up('navigation_move', {direction: 'cancel'});
+ this.trigger_up('navigation_move', {direction: 'cancel', originalEvent: ev});
break;
case $.ui.keyCode.UP:
ev.stopPropagation();
diff --git a/addons/web/static/src/js/views/list/list_editable_renderer.js b/addons/web/static/src/js/views/list/list_editable_renderer.js
index 6519fdfaec4..1a2fe3bd624 100644
--- a/addons/web/static/src/js/views/list/list_editable_renderer.js
+++ b/addons/web/static/src/js/views/list/list_editable_renderer.js
@@ -661,6 +661,9 @@ ListRenderer.include({
this._moveToNextLine();
break;
case 'cancel':
+ // stop the original event (typically an ESCAPE keydown), to
+ // prevent from closing the potential dialog containing this list
+ ev.data.originalEvent.stopPropagation();
this.trigger_up('discard_changes', {
recordID: ev.target.dataPointID,
});