set aria label for table (#8443)

This commit is contained in:
Alan Ren
2019-11-22 16:05:57 -08:00
committed by GitHub
parent 98abf4a758
commit c03cce7f60
3 changed files with 10 additions and 1 deletions

View File

@@ -92,7 +92,8 @@ export class ResourceTypePickerDialog extends DialogBase {
this._toolsTable = view.modelBuilder.table().withProperties<azdata.TableComponentProperties>({
data: [],
columns: [toolColumn, descriptionColumn, installStatusColumn, versionColumn, minVersionColumn],
width: tableWidth
width: tableWidth,
ariaLabel: localize('deploymentDialog.RequiredToolsTitle', "Required tools")
}).component();
const toolsTableWrapper = view.modelBuilder.divContainer().withLayout({ width: tableWidth }).component();

View File

@@ -364,4 +364,8 @@ export class Table<T extends Slick.SlickData> extends Widget implements IDisposa
public set ariaRole(value: string) {
this._tableContainer.setAttribute('role', value);
}
public set ariaLabel(value: string) {
this._tableContainer.setAttribute('aria-label', value);
}
}

View File

@@ -252,6 +252,10 @@ export default class TableComponent extends ComponentBase implements IComponent,
this._table.ariaRole = this.ariaRole;
}
if (this.ariaLabel) {
this._table.ariaLabel = this.ariaLabel;
}
if (this.updateCells !== undefined) {
this.updateTableCells(this.updateCells);
}