[FIX] web_editor: wrong focus detection in the editor
Issue detected with tests in the branch that replace deferred by native Promise. Need to add isMedia to detect if the target is already a media when focus the editor. closes odoo/odoo#31632 Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
This commit is contained in:
@@ -86,7 +86,7 @@ var MediaPlugin = AbstractPlugin.extend({
|
||||
* @param {Node} target
|
||||
*/
|
||||
update: function (target) {
|
||||
if (!target) {
|
||||
if (!target || !dom.isMedia(target)) {
|
||||
return;
|
||||
}
|
||||
if (!this.options.displayPopover(target)) {
|
||||
|
||||
@@ -610,7 +610,7 @@ var Wysiwyg = Widget.extend({
|
||||
this._editableHasFocus = true;
|
||||
this._justFocused = true;
|
||||
setTimeout(function () {
|
||||
self._justFocused = true;
|
||||
self._justFocused = false;
|
||||
});
|
||||
},
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user