summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxLarue <mla@odoo.com>2019-09-04 09:37:54 +0000
committerGeoffroy Larue <gla@odoo.com>2019-09-18 12:05:19 +0000
commit8ed94a11f4344b274d3e2e0e61490cbb30ca863e (patch)
treef35917d8ebbf0f30088f18020b5d3c031b0036a8
parent438194fa9dcd702ba7a99cd8c633a9b80498d7db (diff)
[IMP] wysiwig widget: fix wysiwig widget autofocusing
When clicking on edit in a form with a wysiwig widget inside, that widget would gain focus. It is not the expected behaviour (focusing the first field) and is really an issue on mobile, where the screen would scroll and the keyboard open. The mouseup event was there to force summernote refreshing the editor toolbar (which will not display which buttons were active until the editor is focused). So removing it still has drawbacks (the toolbar is not up-to-date), but with chm it was decided to remove it as the issue with focus is worse. Task-2047389 Closes #36360
-rw-r--r--addons/web_editor/static/src/js/wysiwyg/wysiwyg.js4
1 files changed, 1 insertions, 3 deletions
diff --git a/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js b/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js
index d33f5455da4..361355c4cab 100644
--- a/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js
+++ b/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js
@@ -78,9 +78,7 @@ var Wysiwyg = Widget.extend({
this.$editor.data('oe-id', options.recordInfo.res_id);
$(document).on('mousedown', this._blur);
this._value = this.$target.html() || this.$target.val();
- return this._super.apply(this, arguments).then(() => {
- this.$editor.trigger('mouseup');
- });
+ return this._super.apply(this, arguments);
},
/**
* @override