diff --git a/src/vs/base/parts/quickopen/browser/quickOpenWidget.ts b/src/vs/base/parts/quickopen/browser/quickOpenWidget.ts index 540ee7ddccb1bbf2afc8ff5256c79166c1d94c14..f4a91d4cc90e6a19315ab9bbaccda2094f418a4f 100644 --- a/src/vs/base/parts/quickopen/browser/quickOpenWidget.ts +++ b/src/vs/base/parts/quickopen/browser/quickOpenWidget.ts @@ -244,7 +244,8 @@ export class QuickOpenWidget implements IModelProvider { alwaysFocused: true, verticalScrollMode: ScrollbarVisibility.Visible, ariaLabel: nls.localize('treeAriaLabel', "Quick Picker"), - keyboardSupport: this.options.keyboardSupport + keyboardSupport: this.options.keyboardSupport, + preventRootFocus: true }); this.treeElement = this.tree.getHTMLElement(); diff --git a/src/vs/base/parts/tree/browser/tree.ts b/src/vs/base/parts/tree/browser/tree.ts index ab01546278c3decd63a123d4a335a70c01f3c428..090c09e3d6075c14059e561c450e49c0ad2a9ca9 100644 --- a/src/vs/base/parts/tree/browser/tree.ts +++ b/src/vs/base/parts/tree/browser/tree.ts @@ -670,6 +670,7 @@ export interface ITreeOptions extends ITreeStyles { paddingOnRow?: boolean; ariaLabel?: string; keyboardSupport?: boolean; + preventRootFocus?: boolean; } export interface ITreeStyles { diff --git a/src/vs/base/parts/tree/browser/treeView.ts b/src/vs/base/parts/tree/browser/treeView.ts index afa1d0bbb3916ed43f3223aa01eb53733431e02f..f28d93108af461f0d45abeaa58202982bc1759fb 100644 --- a/src/vs/base/parts/tree/browser/treeView.ts +++ b/src/vs/base/parts/tree/browser/treeView.ts @@ -444,7 +444,9 @@ export class TreeView extends HeightMap { this.domNode = document.createElement('div'); this.domNode.className = `monaco-tree no-focused-item monaco-tree-instance-${this.instance}`; - this.domNode.tabIndex = container.className === 'quick-open-tree' ? -1 : 0; + if (!context.options.preventRootFocus) { + this.domNode.tabIndex = 0; + } this.styleElement = DOM.createStyleSheet(this.domNode);