diff --git a/src/sql/workbench/browser/modelComponents/treeComponentRenderer.ts b/src/sql/workbench/browser/modelComponents/treeComponentRenderer.ts index ef870ebdbf..31f26fcb48 100644 --- a/src/sql/workbench/browser/modelComponents/treeComponentRenderer.ts +++ b/src/sql/workbench/browser/modelComponents/treeComponentRenderer.ts @@ -67,6 +67,13 @@ export class TreeDataTemplate extends Disposable { } } + /** + * Sets the `aria-label` of the checkbox element associated with the tree node. + */ + public set checkboxLabel(value: string) { + this._checkbox.setAttribute('aria-label', value); + } + public set enableCheckbox(value: boolean) { if (value === undefined) { value = true; @@ -160,8 +167,13 @@ export class TreeComponentRenderer extends Disposable implements IRenderer { let label = treeNode.label; templateData.label.textContent = label.label; templateData.root.title = label.label; - templateData.checkboxState = this.getCheckboxState(treeNode); - templateData.enableCheckbox = treeNode.enabled; + + if (templateData.checkbox) { + // Set the properties of the node's checkbox, if it is present + templateData.checkboxState = this.getCheckboxState(treeNode); + templateData.enableCheckbox = treeNode.enabled; + templateData.checkboxLabel = label.label; + } } private getCheckboxState(treeNode: ITreeComponentItem): TreeCheckboxState {