From 03f8dffebdbd096812c6d4a09f290077e708218d Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Thu, 18 Feb 2021 09:04:42 +0000 Subject: [PATCH] [FIX] web_editor: shift+enter in editor add direct newline Enter keypress browser event were removed in 3c372d1da8b. It was reintroduced in text fields with d2f024d2543 and in source mode of html field with b10ca1f6094b. When doing ENTER in the editor, we do our special case of ENTER (eg. it will split the container in two and have other custom behavior) but when doing SHIFT+ENTER we let the browser handle it and add a normal newline. With the "Enter" prevention, SHIFT+ENTER did not work. opw-2463746 closes odoo/odoo#66455 X-original-commit: 27b84138b422f0dbb3e01c83bb817d0880e3eab3 Signed-off-by: Nicolas Lempereur (nle) --- addons/web_editor/static/src/js/backend/field_html.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web_editor/static/src/js/backend/field_html.js b/addons/web_editor/static/src/js/backend/field_html.js index 999766d44e0..fbae41446af 100644 --- a/addons/web_editor/static/src/js/backend/field_html.js +++ b/addons/web_editor/static/src/js/backend/field_html.js @@ -465,7 +465,7 @@ var FieldHtml = basic_fields.DebouncedField.extend(TranslatableFieldMixin, { * @param {OdooEvent} ev */ _onKeydown: function (ev) { - if (ev.which === $.ui.keyCode.ENTER && $(ev.target).is('textarea')) { + if (ev.which === $.ui.keyCode.ENTER) { ev.stopPropagation(); return; }