Skip to content
Snippets Groups Projects
Commit 27b84138 authored by Nicolas Lempereur's avatar Nicolas Lempereur
Browse files

[FIX] web_editor: shift+enter in editor add direct newline


Enter keypress browser event were removed in 3c372d1d.

It was reintroduced in text fields with d2f024d2 and in source mode
of html field with b10ca1f6.

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#66426

Signed-off-by: default avatarNicolas Lempereur (nle) <nle@odoo.com>
parent d139b509
No related branches found
No related tags found
No related merge requests found
......@@ -458,7 +458,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;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment