提交 6fb1d38e 编写于 作者: B Benjamin Pasero

tree - allow to add aria label as option

上级 56765dfc
......@@ -605,6 +605,7 @@ export interface ITreeOptions {
bare?:boolean;
useShadows?:boolean;
paddingOnRow?:boolean;
ariaLabel?:string;
}
export interface ITreeContext extends ITreeConfiguration {
......
......@@ -461,9 +461,14 @@ export class TreeView extends HeightMap implements IScrollable {
this.domNode = document.createElement('div');
this.domNode.className = 'monaco-tree';
this.domNode.setAttribute('role', 'tree');
this.domNode.tabIndex = 0;
// ARIA
this.domNode.setAttribute('role', 'tree');
if (this.context.options.ariaLabel) {
this.domNode.setAttribute('aria-label', this.context.options.ariaLabel);
}
if (this.context.options.alwaysFocused) {
DOM.addClass(this.domNode, 'focused');
}
......
......@@ -314,7 +314,8 @@ export class ExplorerView extends CollapsibleViewletView {
filter: this.filter,
dnd: dnd
}, {
autoExpandSingleChildren: true
autoExpandSingleChildren: true,
ariaLabel: nls.localize('explorerTreeAriaLabel', "Explorer Files Tree")
});
this.toDispose.push(lifecycle.toDisposable(() => renderer.dispose()));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册