Add aria-label to table headers with no title (#11503)

This commit is contained in:
Patrick ZAJDA
2022-02-09 19:10:41 +01:00
committed by GitHub
parent 4db943c5ff
commit d37d99223d
12 changed files with 75 additions and 6 deletions

View File

@@ -70,6 +70,7 @@ export interface DataTableSortColumnData {
export interface DataTableColumnData<T = any> extends DataTableSortColumnData {
title: TemplateResult | string;
label?: TemplateResult | string;
type?: "numeric" | "icon" | "icon-button" | "overflow-menu";
template?: (data: any, row: T) => TemplateResult | string;
width?: string;
@@ -294,6 +295,7 @@ export class HaDataTable extends LitElement {
};
return html`
<div
aria-label=${column.label}
class="mdc-data-table__header-cell ${classMap(classes)}"
style=${column.width
? styleMap({