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 cdd4a876f99..f6b7ac1efea 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 @@ -3536,6 +3536,17 @@ export class OdooEditor extends EventTarget { return; } + let appliedCustomSelection = false; + if (selection.rangeCount && selection.getRangeAt(0)) { + appliedCustomSelection = this._handleSelectionInTable(); + if (this.options.onCollaborativeSelectionChange) { + this.options.onCollaborativeSelectionChange(this.getCurrentCollaborativeSelection()); + } + } + if (!appliedCustomSelection) { + this._updateToolbar(!selection.isCollapsed && this.isSelectionInEditable(selection)); + } + if ( !this.editable.contains(selection.anchorNode) && !this.editable.contains(selection.focusNode) @@ -3567,16 +3578,6 @@ export class OdooEditor extends EventTarget { if (this._currentMouseState === 'mouseup') { this._fixFontAwesomeSelection(); } - let appliedCustomSelection = false; - if (selection.rangeCount && selection.getRangeAt(0)) { - appliedCustomSelection = this._handleSelectionInTable(); - if (this.options.onCollaborativeSelectionChange) { - this.options.onCollaborativeSelectionChange(this.getCurrentCollaborativeSelection()); - } - } - if (!appliedCustomSelection) { - this._updateToolbar(!selection.isCollapsed && this.isSelectionInEditable(selection)); - } } /**