From 5b04b4511cd47edda945c350c25df6d2b42fa933 Mon Sep 17 00:00:00 2001 From: Nicolas Bayet Date: Wed, 10 Jan 2024 10:47:45 +0100 Subject: [PATCH] [FIX] web_editor: reset the collaborative selection when reset content MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When the content of the editor is reset, the collaborative selection should be reset as well. Otherwise, the selection is not reset and the user can still see the selection of the previous content. task-3675074 closes odoo/odoo#148826 Signed-off-by: Geelen Sébastien (sge) --- .../static/src/js/editor/odoo-editor/src/OdooEditor.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 353f26c3f3d..2fa65aae6d9 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 @@ -869,6 +869,7 @@ export class OdooEditor extends EventTarget { if (this.editable.textContent === '' && this.options.placeholder) { this._makeHint(this.editable.firstChild, this.options.placeholder, true); } + this.multiselectionRefresh(); } sanitize(target) { @@ -1821,6 +1822,7 @@ export class OdooEditor extends EventTarget { } _drawClientSelection({ selection, color, clientId, clientName = this.options._t('Anonymous') }) { + this._multiselectionRemoveClient(clientId); let clientRects; let anchorNode = this.idFind(selection.anchorNodeOid); @@ -1906,7 +1908,6 @@ export class OdooEditor extends EventTarget { caretElement.style.top = `${rect.y - containerRect.y}px`; caretElement.style.left = `${rect.right - containerRect.x}px`; } - this._multiselectionRemoveClient(clientId); this._selectionsContainer.append(caretElement, ...indicators); }