From c710994e2ee4e0a72ababa03c5c3ab9ece090cb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 28 May 2025 18:15:07 +0200 Subject: [PATCH] Store the selected state before deselect all the rows We must toggle the state of the row based on the original state. Otherwise on single mode, clicking on a selected row keep it selected. Closes #14045 --- sao/src/view/tree.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sao/src/view/tree.js b/sao/src/view/tree.js index b4205d84e9..f21afdd85f 100644 --- a/sao/src/view/tree.js +++ b/sao/src/view/tree.js @@ -2022,12 +2022,13 @@ current_record = this.tree.screen.current_record; this.tree.select_records(current_record, this.record); } else { + let selected = this.is_selected(); if (!(event_.ctrlKey || event_.metaKey) || this.tree.selection_mode == Sao.common.SELECTION_SINGLE) { this.tree.select_records(null, null); } - this.set_selection(!this.is_selected()); + this.set_selection(!selected); } if (event_.shiftKey || event_.ctrlKey || event_.metaKey) { Sao.common.clear_selection();