mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-09-09 18:03:21 +00:00
[ACS-10310] Fix a11y - Screen reader announces column header as undefined (#11328)
This commit is contained in:
@@ -54,7 +54,7 @@
|
|||||||
'adf-datatable__header--sorted-asc': isColumnSorted(col, 'asc'),
|
'adf-datatable__header--sorted-asc': isColumnSorted(col, 'asc'),
|
||||||
'adf-datatable__header--sorted-desc': isColumnSorted(col, 'desc')}"
|
'adf-datatable__header--sorted-desc': isColumnSorted(col, 'desc')}"
|
||||||
[ngStyle]="(col.width) && !lastColumn && {'flex': getFlexValue(col)}"
|
[ngStyle]="(col.width) && !lastColumn && {'flex': getFlexValue(col)}"
|
||||||
[attr.aria-label]="(col.title | translate) + (col.subtitle ? ' ' + col.subtitle : '')"
|
[attr.aria-label]="col.srTitle ? (col.srTitle | translate) : (col.title | translate) + (col.subtitle ? ' ' + (col.subtitle | translate) : '')"
|
||||||
(click)="onColumnHeaderClick(col, $event)"
|
(click)="onColumnHeaderClick(col, $event)"
|
||||||
(keyup.enter)="onColumnHeaderClick(col, $event)"
|
(keyup.enter)="onColumnHeaderClick(col, $event)"
|
||||||
role="columnheader"
|
role="columnheader"
|
||||||
@@ -279,7 +279,11 @@
|
|||||||
<div *ngIf="!col.template" class="adf-datatable-cell-container">
|
<div *ngIf="!col.template" class="adf-datatable-cell-container">
|
||||||
<ng-container [ngSwitch]="data.getColumnType(row, col)">
|
<ng-container [ngSwitch]="data.getColumnType(row, col)">
|
||||||
<div *ngSwitchCase="'image'" class="adf-cell-value">
|
<div *ngSwitchCase="'image'" class="adf-cell-value">
|
||||||
<mat-icon *ngIf="isIconValue(row, col); else no_iconvalue">{{ asIconValue(row, col) }}
|
<mat-icon
|
||||||
|
[attr.aria-label]="col.srTitle? (col.srTitle | translate) : null"
|
||||||
|
[attr.aria-hidden]="!asIconValue(row, col)"
|
||||||
|
*ngIf="isIconValue(row, col); else no_iconvalue">
|
||||||
|
{{ asIconValue(row, col) }}
|
||||||
</mat-icon>
|
</mat-icon>
|
||||||
<ng-template #no_iconvalue>
|
<ng-template #no_iconvalue>
|
||||||
<mat-icon class="adf-datatable-selected"
|
<mat-icon class="adf-datatable-selected"
|
||||||
|
|||||||
@@ -130,7 +130,7 @@ export class DataColumnComponent implements OnInit {
|
|||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
if (!this.srTitle && this.key === '$thumbnail') {
|
if (!this.srTitle && this.key === '$thumbnail') {
|
||||||
this.srTitle = 'Thumbnail';
|
this.srTitle = 'ADF-DOCUMENT-LIST.LAYOUT.THUMBNAIL';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user