trees: always handle an twistie events by the tree if it changes collapsed 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
This commit is contained in:
Connor Peet 2024-03-29 00:53:17 -07:00 committed by GitHub
parent 86bf11fe76
commit e2dc70e393
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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;