User stories
The following user stories can be used to understand when this component should be used, and how to know when it's been implemented correctly.
- As a keyboard-only user, only when scrolling is present, I want to be able to navigate to the table using Tab and scroll using the arrow keys.
- As a screen reader user, I want to be able to quickly understand the content contained within the table from the table's caption.
- As a screen reader user, I want to be able to understand the structure of the table, with information about headings present, and content announced in a meaningful order, matching the visual presentation.
- As a screen reader user, when scrolling is present, I want to be able to navigate to the table and have the name of it announced so that I know what I am interacting with.
Test steps
Use these steps to check that the data table component has been implemented correctly:
- Turn on a screen reader.
- Navigate to the table.
- If a caption is present, verify that it is announced correctly.
- Verify that headings are announced as such.
- As the screen reader announces the content in the table, verify it does such in a way that matches the visual presentation of the table, and that the meaning of the information is conveyed appropriately.
Known defects
We're aware of the following defects and have provided ways that these can be manually resolved, until this component is updated:
- When the viewport becomes small enough, the datatables allow for scrolling, but cannot be scrolled using only a keyboard. To resolve this, where possible, allow the table to receive focus by adding a tabindex="0" attribute to the scrollable container, update the role to be role="region" and provide it with a sensible accessible name (using the table's caption, if there is one). The accessible name can be added by providing an aria-label attribute to the scrollable container. When scrolling is not present as the viewport is large enough, the container should not receive focus as there is no longer any need. This behaviour can be managed using the ResizeObserver API, ensuring that the container can only be navigated to when it is small enough to require scrolling.
|
Accessibility checklist |
|
|---|---|
|
User stories |
✅ |
|
Known defects |
✅ |