Skip to content

Commit f2b65a9

Browse files
authored
Fix opening of tree items with keyboard (microsoft#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 microsoft#78174
1 parent f2f21da commit f2b65a9

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/vs/base/browser/ui/tree/asyncDataTree.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -602,9 +602,9 @@ export class AsyncDataTree<TInput, T, TFilterData = void> implements IDisposable
602602
return nodes.map(n => n!.element as T);
603603
}
604604

605-
open(elements: T[]): void {
605+
open(elements: T[], browserEvent?: UIEvent): void {
606606
const nodes = elements.map(e => this.getDataNode(e));
607-
this.tree.open(nodes);
607+
this.tree.open(nodes, browserEvent);
608608
}
609609

610610
reveal(element: T, relativeTop?: number): void {

0 commit comments

Comments
 (0)