Add accessibility information for MIAA deployment link (#16064)

* Add accessibility information for MIAA deployment link

* optional
This commit is contained in:
Charles Gagnon
2021-07-12 10:08:59 -07:00
committed by GitHub
parent d8433ddbf4
commit ba20cdb885
4 changed files with 21 additions and 1 deletions

View File

@@ -887,6 +887,15 @@ declare module 'azdata' {
appendData(data: any[][]): Thenable<void>;
}
export interface LinkArea {
/*
* Accessibility information used when screen reader interacts with this link.
* Generally, a link has no need to set the `role` of the accessibilityInformation;
* but it is exposed for situations that may require it.
*/
accessibilityInformation?: vscode.AccessibilityInformation
}
export interface IconColumnCellValue {
/**
* The icon to be displayed.

View File

@@ -124,6 +124,13 @@ export default class TextComponent extends TitledComponent<azdata.TextComponentP
label: link.text,
href: link.url
}));
if (link.accessibilityInformation) {
linkElement.el.setAttribute('aria-label', link.accessibilityInformation.label);
if (link.accessibilityInformation.role) {
linkElement.el.setAttribute('role', link.accessibilityInformation.role);
}
}
this._register(attachLinkStyler(linkElement, this.themeService));
(<HTMLElement>this.textContainer.nativeElement).appendChild(linkElement.el);