Skip to content

Commit 6cf44b4

Browse files
classix-asmportuga
authored andcommitted
fix(ARIA-Roles): Improving accessibility of ui-grid. (#6341)
* Removed wrong role for pagination (it is not the footer of the page, see https://www.w3.org/TR/wai-aria/roles#contentinfo) * Removed role menubar from pagination-footer because it does not comply with the expected keyboard behaviour: https://www.w3.org/TR/wai-aria-practices-1.1/#keyboard-interaction-11 * ARIA-information about the selection checkboxes. These have been implemented in such a way that ngAria can work with them: https://docs.angularjs.org/guide/accessibility#example * Moved role=grid to grid-content-wrapper and marked the render container as role=presentation. This is in accordance with ARIA-recommondation for fixed header: https://www.paciellogroup.com/blog/2014/10/notes-on-fixing-incorrect-table-structure-using-aria/ http://juicystudio.com/displayarticle.php/accessible_data_tables_static_headers.php?page=accessible_data_tables_static_headers.php
1 parent 57d258e commit 6cf44b4

File tree

5 files changed

+8
-10
lines changed

5 files changed

+8
-10
lines changed

src/features/pagination/templates/pagination.html

-6
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
11
<div
2-
role="contentinfo"
32
class="ui-grid-pager-panel"
43
ui-grid-pager
54
ng-show="grid.options.enablePaginationControls">
65
<div
76
role="navigation"
87
class="ui-grid-pager-container">
98
<div
10-
role="menubar"
119
class="ui-grid-pager-control">
1210
<button
1311
type="button"
14-
role="menuitem"
1512
class="ui-grid-pager-first"
1613
ui-grid-one-bind-title="aria.pageToFirst"
1714
ui-grid-one-bind-aria-label="aria.pageToFirst"
@@ -26,7 +23,6 @@
2623
</button>
2724
<button
2825
type="button"
29-
role="menuitem"
3026
class="ui-grid-pager-previous"
3127
ui-grid-one-bind-title="aria.pageBack"
3228
ui-grid-one-bind-aria-label="aria.pageBack"
@@ -54,7 +50,6 @@
5450
</span>
5551
<button
5652
type="button"
57-
role="menuitem"
5853
class="ui-grid-pager-next"
5954
ui-grid-one-bind-title="aria.pageForward"
6055
ui-grid-one-bind-aria-label="aria.pageForward"
@@ -64,7 +59,6 @@
6459
</button>
6560
<button
6661
type="button"
67-
role="menuitem"
6862
class="ui-grid-pager-last"
6963
ui-grid-one-bind-title="aria.pageToLast"
7064
ui-grid-one-bind-aria-label="aria.pageToLast"

src/features/selection/templates/selectionHeaderCell.html

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
class="ui-grid-cell-contents"
55
col-index="renderIndex">
66
<ui-grid-selection-select-all-buttons
7-
ng-if="grid.options.enableSelectAll">
7+
ng-if="grid.options.enableSelectAll"
8+
role="checkbox"
9+
ng-model="grid.selection.selectAll">
810
</ui-grid-selection-select-all-buttons>
911
</div>
1012
</div>
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<div
22
class="ui-grid-selection-row-header-buttons ui-grid-icon-ok"
33
ng-class="{'ui-grid-row-selected': row.isSelected}"
4-
ng-click="selectButtonClick(row, $event)">
4+
ng-click="selectButtonClick(row, $event)"
5+
role="checkbox"
6+
ng-model="row.isSelected">
57
&nbsp;
68
</div>

src/templates/ui-grid/ui-grid.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
{{ grid.customStyles }}
2626
</style>
2727

28-
<div class="ui-grid-contents-wrapper">
28+
<div class="ui-grid-contents-wrapper" role="grid">
2929
<div ui-grid-menu-button ng-if="grid.options.enableGridMenu"></div>
3030

3131
<div ng-if="grid.hasLeftContainer()" style="width: 0" ui-grid-pinned-container="'left'"></div>

src/templates/ui-grid/uiGridRenderContainer.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<div
2-
role="grid"
2+
role="presentation"
33
ui-grid-one-bind-id-grid="'grid-container'"
44
class="ui-grid-render-container"
55
ng-style="{ 'margin-left': colContainer.getMargin('left') + 'px', 'margin-right': colContainer.getMargin('right') + 'px' }">

0 commit comments

Comments
 (0)