Skip to content

Commit

Permalink
fix(a11y): datagrid aria-label in table header is not announced by sc…
Browse files Browse the repository at this point in the history
…reen reader
  • Loading branch information
Andrea Fernandes committed May 7, 2024
1 parent 9c67c41 commit ee37aa1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 5 additions & 1 deletion projects/angular/src/data/datagrid/datagrid-row.html
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,11 @@
<clr-spinner *ngIf="expand.loading" clrSmall>{{ commonStrings.keys.loading }}</clr-spinner>
</ng-container>
</div>
<div *ngIf="detailService.enabled" class="datagrid-detail-caret datagrid-fixed-column datagrid-cell">
<div
*ngIf="detailService.enabled"
class="datagrid-detail-caret datagrid-fixed-column datagrid-cell"
role="gridcell"
>
<button
(click)="detailService.toggle(item, detailButton)"
type="button"
Expand Down
6 changes: 3 additions & 3 deletions projects/angular/src/data/datagrid/datagrid.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,26 +45,26 @@
role="columnheader"
class="datagrid-column datagrid-select datagrid-fixed-column"
*ngIf="selection.selectionType === SELECTION_TYPE.Single"
[attr.aria-label]="clrDgSingleSelectionAriaLabel"
>
<div class="clr-sr-only">{{clrDgSingleSelectionAriaLabel}}</div>
<div class="datagrid-column-separator"></div>
</div>
<!-- header for single row action; only displayType if we have at least one actionable row in datagrid -->
<div
role="columnheader"
class="datagrid-column datagrid-row-actions datagrid-fixed-column"
*ngIf="rowActionService.hasActionableRow"
[attr.aria-label]="clrDgSingleActionableAriaLabel"
>
<div class="clr-sr-only">{{clrDgSingleActionableAriaLabel}}</div>
<div class="datagrid-column-separator"></div>
</div>
<!-- header for carets; only displayType if we have at least one expandable row in datagrid -->
<div
role="columnheader"
class="datagrid-column datagrid-expandable-caret datagrid-fixed-column"
*ngIf="expandableRows.hasExpandableRow || detailService.enabled"
[attr.aria-label]="clrDetailExpandableAriaLabel"
>
<div class="clr-sr-only">{{clrDetailExpandableAriaLabel}}</div>
<div class="datagrid-column-separator"></div>
</div>
</div>
Expand Down

0 comments on commit ee37aa1

Please sign in to comment.