Accessibility in Grid component
9 Feb 202420 minutes to read
The Grid component followed the accessibility guidelines and standards, including ADA, Section 508, WCAG 2.2 standards, and WCAG roles that are commonly used to evaluate accessibility.
The accessibility compliance for the Grid component is outlined below.
WAI-ARIA attributes
The Grid component followed the WAI-ARIA patterns to meet the accessibility. The following ARIA attributes are used in the Grid component:
Attributes | Purpose |
---|---|
role=grid |
To represent the element containing the grid component. |
role=row |
To represent the element containing the cells of the row in the grid. |
role=rowgroup |
To represent the group of rows in the grid. |
role=columnheader |
To represent the cell in a row contains header information for a column in the grid. |
role=gridcell |
To represent a cell in the grid component. |
role=button |
To represent the element that acts as a button in the grid. |
role=search |
To represent the element that acts as a search region in the grid. |
role=presentation |
To represent the element to be not available for accessibility concerns. |
role=navigation |
To represent the element containing pager elements to navigate from one page to another. |
aria-colindex |
Defines the column index of the column with respect to the total number of columns within the grid. |
aria-rowindex |
Defines row index of the row with respect to the total number of rows within the grid. |
aria-rowspan |
Defines the number of rows spanned by a cell within the grid. |
aria-colspan |
Defines the number of columns spanned by a cell within the grid. |
aria-rowcount |
Defines the total number of rows in the grid. |
aria-colcount |
Defines the total number of columns in the grid. |
aria-selected |
Indicates the current “selected” state of the rows and cells in the grid. |
aria-expanded |
Indicate if the expand icon in the hierarchy grid or grouped grid or detail grid is expanded or collapsed |
aria-sort |
Indicates whether the data in the grid are sorted in ascending or descending order. |
aria-busy |
Indicates an element is being modified and that assistive technologies may want to wait until the changes are complete before informing the user about the update. |
aria-owns |
Identifies an element in order to define a visual, functional, or contextual relationship between a parent and its child elements. |
aria-hidden |
Hides the element from accessibility concerns. |
aria-labelledby |
Provides an accessible name for the checkbox labels in excel filter, checkbox filter and column chooser dialog. |
aria-describedby |
Provides an description about the features enabled in the header when the grid header cell is focused. |
The Syncfusion Grid component is structured with a two-table architecture for its header and content. To enhance accessibility for screen readers, roles and ARIA attributes are incorporated for both the grid parent and all its child elements. Although this architectural approach may have some limitations with accessibility checker tools. It’s important to note that these limitations do not affect the readability of the grid content over screen readers.
The accessibility checker tools highlights the following known issues:
-
aria-required-children: This warning appears when rendering the grid without any features, as it contains textarea and grid content. Additionally, it appears when enabling features such as the toolbar and grouping.
-
color-contrast: This warning appears when you are enabling the search item in the grid’s toolbar.
-
An explicit ARIA ‘role’ is not valid for
<tr>
element within an ARIA role ‘grid’ per the ARIA in HTML specification. -
An explicit ARIA ‘role’ is not valid for
<th>
element within an ARIA role ‘grid’ per the ARIA in HTML specification. -
An explicit ARIA ‘role’ is not valid for
<td>
element within an ARIA role ‘grid’ per the ARIA in HTML specification. -
The element with role “button” contains descendants with roles “rowgroup” which are ignored by browsers.
-
Content is not within a landmark element.
-
Multiple elements with “search” role do not have unique labels.
-
Text contrast of 4.10 with its background is less than the WCAG AA minimum requirements for text of size 13px and weight of 400.
-
Interactive component with ARIA role ‘grid’ does not have a programmatically associated name.
-
The element with role “rowgroup” is not contained in or owned by an element with one of the following roles: “grid, table, treegrid”.
Keyboard interaction
The Grid component followed the keyboard interaction guideline, making it easy for people who use assistive technologies (AT) and those who completely rely on keyboard navigation. The following keyboard shortcuts are supported by the Grid component.
Pager
Windows | MAC | To do this |
---|---|---|
Tab | Tab | Focus on the next pager item. |
Shift + Tab | Shift + Tab | Focus on the previous pager item. |
Enter / Space | Enter / Space | Select the currently focused page. |
PageUp / Left Arrow | Left Arrow | Navigate to previous page. |
PageDown / Right Arrow | Right Arrow | Navigate to next page. |
Home / Ctrl + Alt + PageUp | Fn + Left Arrow | Navigate to first page. |
End / Ctrl + Alt + PageDown | Fn + Right Arrow | Navigate to last page. |
Focus Elements
Windows | MAC | To do this |
---|---|---|
Home | Fn + Left Arrow | Moves the focus to the first cell of the focused row. |
End | Fn + Right Arrow | Moves the focus to the last cell of the focused row. |
Ctrl + Home | Command + Fn + Left Arrow | Moves the focus to the first Cell of the first row in the grid. |
Ctrl + End | Command + Fn + Right Arrow | Moves the focus to the last Cell of the last row in the grid. |
Up Arrow | Up Arrow | Moves the cell focus upward from the focused cell. |
Down Arrow | Down Arrow | Moves the cell focus downward from the focused cell. |
Right Arrow | Right Arrow | Moves the cell focus right side from the focused cell. |
Left Arrow | Left Arrow | Moves the cell focus left side from the focused cell. |
Alt + J | Alt + J | Moves the focus to the entire grid. |
Alt + W | Alt + W | Move the focus to the grid content element. |
Selection
Windows | MAC | To do this |
---|---|---|
Up Arrow | Up Arrow | Moves up a row/cell selection from the selected row/cell. |
Down Arrow | Down Arrow | Moves down a row/cell selection from the selected row/cell. |
Right Arrow | Right Arrow | Moves to the right cell selection from the selected cell. |
Left Arrow | Left Arrow | Moves to the left cell selection from the selected cell. |
Shift + Up Arrow | Shift + Up Arrow | Extends the row/cell selection upwards from the selected row/cell. |
Shift + Down Arrow | Shift + Down Arrow | Extends the row/cell selection downwards from the selected row/cell. |
Shift + Right Arrow | Shift + Right Arrow | Extends the cell selection to the right side from the selected cell. |
Shift + Left Arrow | Shift + Left Arrow | Extends the cell selection to the left side from the selected cell. |
Enter | Enter | Moves the row/cell selection downward from the selected cell/row. |
Shift + Enter | Shift + Enter | Moves the row/cell selection upward. |
Esc | Esc | Deselects all the selected row/cells. |
Ctrl + A | Ctrl + A | Select all the row/cells in the current page. |
Grouping
Windows | MAC | To do this |
---|---|---|
Ctrl + Up Arrow | Command + Up Arrow | Collapses all the visible groups. |
Ctrl + Down Arrow | Command + Down Arrow | Expands all the visible groups. |
Ctrl + Space | Ctrl + Space | Performs grouping when focused on a header element. |
Enter | Enter | If the current cell is an expand/collapse cell then expands/collapses the current group/detailrow/childgrid. |
Windows | MAC | To do this |
---|---|---|
Ctrl + P | Command + P | Prints the Grid. |
Clipboard
Windows | MAC | To do this |
---|---|---|
Ctrl + C | Command + C | Copies selected rows or cells data into the clipboard. |
Ctrl + Shift + H | Ctrl + Shift + H | Copies selected rows or cells data with header into clipboard |
Editing
Windows | MAC | To do this |
---|---|---|
F2 | F2 | Starts editing of selected row if Mode is Normal/Dialog or Starts editing of selected cell if Mode is Batch. |
Enter | Enter | Saves the current form it the Mode is Normal or Dialog / Saves the current cell and starts editing the next row cell if Mode is Batch. |
Insert | Ctrl + Command + Enter | Creates a new add form depending on the NewRowPosition. |
Delete | Delete | Deletes the current selected record. |
Tab | Tab | Navigates to the next editable cell if the Mode is Normal or Dialog / Saves the current cell and starts editing the next cell is Mode is Batch. |
Shift + Tab | Shift + Tab | Navigates to the previous editable cell if the Mode is Normal or Dialog / Saves the current cell and starts editing the previous cell is Mode is Batch. |
Shift + Enter | Shift + Enter | Saves the current cell and starts editing the previous row cell if Mode is Batch. |
Filtering
Windows | MAC | To do this |
---|---|---|
Alt + Down arrow | Alt + Down arrow | Opens the filter menu(excel, menu and checkbox filter) when its header element is in focused state. |
Column Menu
Windows | MAC | To do this |
---|---|---|
Alt + Down arrow | Alt + Down arrow | Opens column menu when its header element is in focused state. |
Reordering
Windows | MAC | To do this |
---|---|---|
Ctrl + left arrow or right arrow | Command + left arrow or right arrow | Reorders the focused header column to the left or right side. |
Sorting
Windows | MAC | To do this |
---|---|---|
Enter | Enter | Performs sorting(ascending/descending) on a column when its header element is in focused state. |
Ctrl + Enter | Command + Enter | Performs multi-sorting on a column when its header element is in focused state. |
Shift + Enter | Shift + Enter | Clears sorting for the focused header column. |
- The Command and Control keys on Mac devices can be interchanged. When this switch occurs, use the Command key in place of the Control key and the Control key in place of the Command key for the above listed key interactions with Mac devices.
- For example, after switching the keys to group the columns when the header element is focused use Command + Space and for expanding the visible groups use Ctrl + Down Arrow.
Ensuring accessibility
The Grid component’s accessibility levels are ensured through an accessibility-checker and axe-core software tools during automated testing.
The accessibility compliance of the Grid component is shown in the following sample. Open the sample in a new window to evaluate the accessibility of the Grid component with accessibility tools.