From 157732cfb15d743c66c36a1bdcb350026a0473e4 Mon Sep 17 00:00:00 2001 From: Martin Geubelle Date: Tue, 27 Jun 2017 17:56:00 +0200 Subject: [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. --- addons/web/static/src/js/fields/basic_fields.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'addons/web/static/src/js/fields/basic_fields.js') 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); + }, }); /** -- cgit v1.2.3