Skip to content

Commit

Permalink
trees: always handle an twistie events by the tree if it changes coll…
Browse files Browse the repository at this point in the history
…apsed state (#209090)

This allows preserving your multi-selection while expanding/collapsing other nodes in the tree. I think this is a good overall change to make across our UI. E.g. similarly, without this change, you can't expand a folder in the Explorer view without losing your selection state. cc @joaomoreno

Fixes #208852
  • Loading branch information
connor4312 authored Mar 29, 2024
1 parent 86bf11f commit e2dc70e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/vs/base/browser/ui/tree/abstractTree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2295,7 +2295,7 @@ class TreeNodeListMouseController<T, TFilterData, TRef> extends MouseController<
this.tree.setFocus([location]);
this.tree.toggleCollapsed(location, recursive);

if (expandOnlyOnTwistieClick && onTwistie) {
if (onTwistie) {
// Do not set this before calling a handler on the super class, because it will reject it as handled
e.browserEvent.isHandledByList = true;
return;
Expand Down

0 comments on commit e2dc70e

Please sign in to comment.