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

[FIX] web_editor: carriage return in source mode


Enter keypress browser event were removed in 3c372d1d.

It was reintroduced in text fields with d2f024d2 and this PR do the
same and reintroduce it for source mode of FieldHtml (`html` widget).

opw-2302605
closes #55066

Signed-off-by: default avatarNicolas Lempereur (nle) <nle@odoo.com>
parent 49a18eec
No related branches found
No related tags found
No related merge requests found
......@@ -450,6 +450,19 @@ var FieldHtml = basic_fields.DebouncedField.extend(TranslatableFieldMixin, {
$(this).attr('id', 'checklist-id-' + (++max));
});
},
/**
* Allows Enter keypress in a textarea (source mode)
*
* @private
* @param {OdooEvent} ev
*/
_onKeydown: function (ev) {
if (ev.which === $.ui.keyCode.ENTER && $(ev.target).is('textarea')) {
ev.stopPropagation();
return;
}
this._super.apply(this, arguments);
},
/**
* Method called when wysiwyg triggers a change.
*
......
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