From a502bb7223a7c313f9887a29ca60434db1671b60 Mon Sep 17 00:00:00 2001 From: Antoine Guenet Date: Fri, 30 Apr 2021 13:25:28 +0000 Subject: [PATCH] [FIX] web_editor, note: autofocus the editor on load note form view edit On creating a new note, the focus was automatically set into the "tags" field. This was inconvenient and was replaced with an autofocus on the note itself so we the user can immediately start typing. closes odoo/odoo#70195 X-original-commit: 8fe89c5ebc138cb517938dbd6d975b8bec4eaf4d Signed-off-by: David Monjoie (dmo) --- addons/note/views/note_views.xml | 2 +- addons/web_editor/static/src/js/backend/field_html.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/note/views/note_views.xml b/addons/note/views/note_views.xml index 6f6df483300..9f8f43611ce 100644 --- a/addons/note/views/note_views.xml +++ b/addons/note/views/note_views.xml @@ -157,7 +157,7 @@ - +
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 f425b7c75c0..f1ecfe08444 100644 --- a/addons/web_editor/static/src/js/backend/field_html.js +++ b/addons/web_editor/static/src/js/backend/field_html.js @@ -110,7 +110,7 @@ var FieldHtml = basic_fields.DebouncedField.extend(TranslatableFieldMixin, { * @override */ getFocusableElement: function () { - return this.$wysiwygWrapper || $(); + return this.wysiwyg && this.wysiwyg.$editable || $(); }, /** * Do not re-render this field if it was the origin of the onchange call.