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
This commit is contained in:
Cédric Krier
2025-05-28 18:15:07 +02:00
parent 45d3a25343
commit c710994e2e
+2 -1
View File
@@ -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();