From cccc9c47dc0a90a7e5959b8f2d707d3c5c4908d4 Mon Sep 17 00:00:00 2001 From: Adnan Saiyed Date: Thu, 8 Feb 2024 16:39:05 +0530 Subject: [PATCH] [FIX] web_editor: table cells not getting deselected Current behaviour before commit: After selecting cells in table, moving cursor through arrowkeys doesn't deselect cells. Desired behaviour after commit: Now cells are getting deselected. task-3718716 closes odoo/odoo#158265 X-original-commit: 0e8865e06b3cb7e8ee1a2c4983d06baef5b30933 Signed-off-by: Antoine Guenet (age) Signed-off-by: Adnan Saiyed (adsa) --- .../static/src/js/editor/odoo-editor/src/OdooEditor.js | 3 +++ 1 file changed, 3 insertions(+) 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 2cb6f886809..c0c521528e6 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 @@ -4169,6 +4169,9 @@ export class OdooEditor extends EventTarget { let appliedCustomSelection = false; if (selection.rangeCount && selection.getRangeAt(0)) { appliedCustomSelection = this._handleSelectionInTable(); + if (!appliedCustomSelection) { + this.deselectTable(); + } // Handle selection/navigation at the edges of links. const link = getInSelection(this.document, EDITABLE_LINK_SELECTOR);