From f2b65a9601b57778cc15bfd240905132bc25e436 Mon Sep 17 00:00:00 2001 From: Alex Ross Date: Tue, 30 Jul 2019 17:21:15 +0200 Subject: [PATCH] Fix opening of tree items with keyboard (#78187) Up until very recently, the custom tree used a TreeResourceNavigator2 with openOnSelection: true. This caused command to be executed twice on clicks though. Once on the selection and once on the click. Setting that to false caused the enter key to stop causing commands to run though. This was because the enter key was only causing the selection to trigger, not the open. The Open event was getting swallowed before it made it out of the tree because it was missing a UIEvent. Adding the UIEvent in here fixes that Fixes #78174 --- src/vs/base/browser/ui/tree/asyncDataTree.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vs/base/browser/ui/tree/asyncDataTree.ts b/src/vs/base/browser/ui/tree/asyncDataTree.ts index 4421bce8de1..86eaeb31618 100644 --- a/src/vs/base/browser/ui/tree/asyncDataTree.ts +++ b/src/vs/base/browser/ui/tree/asyncDataTree.ts @@ -602,9 +602,9 @@ export class AsyncDataTree implements IDisposable return nodes.map(n => n!.element as T); } - open(elements: T[]): void { + open(elements: T[], browserEvent?: UIEvent): void { const nodes = elements.map(e => this.getDataNode(e)); - this.tree.open(nodes); + this.tree.open(nodes, browserEvent); } reveal(element: T, relativeTop?: number): void { -- GitLab