diff --git a/addons/web_editor/static/src/js/editor/odoo-editor/src/OdooEditor.js b/addons/web_editor/static/src/js/editor/odoo-editor/src/OdooEditor.js index 7f80d848b53..3e76e670826 100644 --- a/addons/web_editor/static/src/js/editor/odoo-editor/src/OdooEditor.js +++ b/addons/web_editor/static/src/js/editor/odoo-editor/src/OdooEditor.js @@ -4100,9 +4100,6 @@ export class OdooEditor extends EventTarget { // wasn't changed. this._setLinkZws(); - if (this.options.onCollaborativeSelectionChange) { - this.options.onCollaborativeSelectionChange(this.getCurrentCollaborativeSelection()); - } } const isSelectionInEditable = this.isSelectionInEditable(selection); if (!appliedCustomSelection) { @@ -4135,6 +4132,13 @@ export class OdooEditor extends EventTarget { if (this._currentMouseState === 'mouseup') { this._fixFontAwesomeSelection(); } + if ( + selection.rangeCount && + selection.getRangeAt(0) && + this.options.onCollaborativeSelectionChange + ) { + this.options.onCollaborativeSelectionChange(this.getCurrentCollaborativeSelection()); + } } /**