tree: clicking on twistie should only expand/collapse if node is collapsible

This commit is contained in:
Joao Moreno 2019-09-09 11:49:55 +02:00
parent 7c678d4e16
commit 6921a8c3ca

View file

@ -1053,13 +1053,15 @@ class TreeNodeListMouseController<T, TFilterData, TRef> extends MouseController<
return super.onPointer(e);
}
const model = ((this.tree as any).model as ITreeModel<T, TFilterData, TRef>); // internal
const location = model.getNodeLocation(node);
const recursive = e.browserEvent.altKey;
model.setCollapsed(location, undefined, recursive);
if (node.collapsible) {
const model = ((this.tree as any).model as ITreeModel<T, TFilterData, TRef>); // internal
const location = model.getNodeLocation(node);
const recursive = e.browserEvent.altKey;
model.setCollapsed(location, undefined, recursive);
if (expandOnlyOnTwistieClick && onTwistie) {
return;
if (expandOnlyOnTwistieClick && onTwistie) {
return;
}
}
super.onPointer(e);