Fix right click selection behavior in project panel (#21707)

Closes #21605

Consider you have set of entries selected or even a single entry
selected, and you right click some other entry which is **not** part of
your selected set. This doesn't not clear existing entries selection
(which it should clear, as how file manager right-click logic works, see
more below).

This issue might lead unexpected operation like deletion applied on
those existing selected entries. This PR fixes it.

Release Notes:

- Fix right click selection behavior in project panel
This commit is contained in:
tims 2024-12-09 07:43:12 +05:30 committed by GitHub
parent bf1525588d
commit 2ce01ead93
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -3496,6 +3496,9 @@ impl ProjectPanel {
// Stop propagation to prevent the catch-all context menu for the project
// panel from being deployed.
cx.stop_propagation();
if !this.marked_entries.contains(&selection) {
this.marked_entries.clear();
}
this.deploy_context_menu(event.position, entry_id, cx);
},
))