summaryrefslogtreecommitdiff
path: root/addons/web/static/src
diff options
context:
space:
mode:
authorMartin Geubelle <mge@odoo.com>2017-06-27 17:56:00 +0200
committerMartin Geubelle <mge@odoo.com>2017-06-28 16:53:45 +0200
commit157732cfb15d743c66c36a1bdcb350026a0473e4 (patch)
treee142b7175052844d24a0430700713373dbf190e5 /addons/web/static/src
parent98602e93cc3f8586db5d22932aecdd5192584a55 (diff)
[FIX] web: FieldText: keep editing the textarea after enter
In the editable list, when pressing enter, the cursor goes to the next line and the current row is saved. This should not be the case for a textarea (i.e. in the FieldText widget). In this particular case, we just want to continue editing the textarea.
Diffstat (limited to 'addons/web/static/src')
-rw-r--r--addons/web/static/src/js/fields/basic_fields.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/addons/web/static/src/js/fields/basic_fields.js b/addons/web/static/src/js/fields/basic_fields.js
index 575fe1875e3..1868a29a237 100644
--- a/addons/web/static/src/js/fields/basic_fields.js
+++ b/addons/web/static/src/js/fields/basic_fields.js
@@ -788,6 +788,23 @@ var FieldText = InputField.extend(TranslatableFieldMixin, {
}
return this._super();
},
+
+ //--------------------------------------------------------------------------
+ // Handlers
+ //--------------------------------------------------------------------------
+
+ /**
+ * Stops the enter navigation in a text area.
+ *
+ * @private
+ * @param {OdooEvent} ev
+ */
+ _onKeydown: function (ev) {
+ if (ev.which === $.ui.keyCode.ENTER) {
+ return;
+ }
+ this._super.apply(this, arguments);
+ },
});
/**