From 2346ddcf36c21410ba1c20b84dfcdf34b32f0f9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 15 Jul 2025 10:21:41 +0200 Subject: [PATCH] Do not change the selection of row when starting the edition The edition of tree row relies on having the current record of the screen set to the row edited. This can be only guarantee if we do not change the selection. Closes #14097 (grafted from 64ddd011cdc1a25649f0f0fa68255073e70d3e84) --HG-- branch : 6.0 --- sao/src/view/tree.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sao/src/view/tree.js b/sao/src/view/tree.js index 7673bc3995..f7f4389b6a 100644 --- a/sao/src/view/tree.js +++ b/sao/src/view/tree.js @@ -1835,10 +1835,13 @@ } listener.on('click.sao.editabletree', handler); - Sao.View.Tree.RowEditable._super.select_row.call(this, event_); - - if (!event_.shiftKey && !(event_.ctrlKey || event_.metaKey)) { + // do not call super when editing row because the selection must + // not be changed + if (!event_.shiftKey && !(event_.ctrlKey || event_.metaKey) && + (this.record === current_record)) { this.tree.edit_row(this); + } else { + Sao.View.Tree.RowEditable._super.select_row.call(this, event_); } }, unset_editable: function() {