summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src
diff options
context:
space:
mode:
authorAnh Thao Pham (pta) <pta@odoo.com>2020-05-27 08:47:26 +0000
committerAnh Thao Pham (pta) <pta@odoo.com>2020-05-27 18:13:00 +0000
commitaca52baee3009ba3d35e9ef1f2128808527e439b (patch)
tree844446175b13160960f2d75df3805e5458d28444 /addons/web_editor/static/src
parent9d40ec7d15898ee9f3d2a92c7264690586c35cd8 (diff)
[FIX] web_editor: fix focus for some tools in Summernote
- Go to Project - Open a project to display Tasks - Switch to list view - Click on create button - On task form page, click nowhere. (It is important to not click on anything) - On the taskbar of the WYSIWYG editor used for Description, click on one of the following actions: * Unordered list * Ordered list * Checklist * Table * Style - The action will be applied to the "name" field (Task Title) and an error will prompt for Unordered list, Ordered list and Checklist actions - If not, discard the form and retry by opening the form with create button In this case, the WYSIWYG editor does not have the focus and try to execute the tool action on the current focused element. opw-2256835 closes odoo/odoo#52023 X-original-commit: eaa55ce3e806ad0d9609394309ff9d48b32bb73f Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Diffstat (limited to 'addons/web_editor/static/src')
-rw-r--r--addons/web_editor/static/src/js/editor/summernote.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/addons/web_editor/static/src/js/editor/summernote.js b/addons/web_editor/static/src/js/editor/summernote.js
index 1053e0699bc..01269589811 100644
--- a/addons/web_editor/static/src/js/editor/summernote.js
+++ b/addons/web_editor/static/src/js/editor/summernote.js
@@ -1031,6 +1031,7 @@ options.styleTags = weDefaultOptions.styleTags;
$.summernote.pluginEvents.insertTable = function (event, editor, layoutInfo, sDim) {
var $editable = layoutInfo.editable();
+ $editable.focus();
var dimension = sDim.split('x');
var r = range.create();
if (!r) return;
@@ -1658,6 +1659,7 @@ function isFormatNode(node) {
$.summernote.pluginEvents.insertUnorderedList = function (event, editor, layoutInfo, type) {
var $editable = layoutInfo.editable();
+ $editable.focus();
$editable.data('NoteHistory').recordUndo($editable);
type = type || "UL";
@@ -1986,6 +1988,7 @@ $.summernote.pluginEvents.outdent = function (event, editor, layoutInfo) {
$.summernote.pluginEvents.formatBlock = function (event, editor, layoutInfo, sTagName) {
$.summernote.pluginEvents.applyFont(event, editor, layoutInfo, null, null, "Default");
var $editable = layoutInfo.editable();
+ $editable.focus();
$editable.data('NoteHistory').recordUndo($editable);
event.preventDefault();