Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tree: fix right-clicking tree nodes bug #12801

Merged
merged 11 commits into from
Aug 17, 2023
8 changes: 5 additions & 3 deletions packages/core/src/browser/tree/tree-widget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1248,9 +1248,11 @@ export class TreeWidget extends ReactWidget implements StatefulWidget {
* @param event the middle-click mouse event.
*/
protected handleAuxClickEvent(node: TreeNode | undefined, event: React.MouseEvent<HTMLElement>): void {
this.model.openNode(node);
if (SelectableTreeNode.is(node)) {
this.model.selectNode(node);
if (event.button === 1) {
this.model.openNode(node);
if (SelectableTreeNode.is(node)) {
this.model.selectNode(node);
}
}
event.stopPropagation();
}
Expand Down
Loading