From e712033314968605df7f0c794c56cabd34272740 Mon Sep 17 00:00:00 2001 From: Cagatay Civici Date: Mon, 30 May 2022 16:57:05 +0300 Subject: [PATCH] a11y for paginator --- components/doc/paginator/index.js | 53 +++++++++++++++++++++++++++++-- 1 file changed, 50 insertions(+), 3 deletions(-) diff --git a/components/doc/paginator/index.js b/components/doc/paginator/index.js index b9c152ce2d..2d94357a86 100644 --- a/components/doc/paginator/index.js +++ b/components/doc/paginator/index.js @@ -3,6 +3,7 @@ import Link from 'next/link'; import { TabView, TabPanel } from '../../lib/tabview/TabView'; import { useLiveEditorTabs } from '../common/liveeditor'; import { CodeHighlight } from '../common/codehighlight'; +import { DevelopmentSection } from '../common/developmentsection'; const PaginatorDoc = memo(() => { @@ -1164,11 +1165,57 @@ const template = { - -
Dependencies
-

None.

+
Accessibility
+ +
Screen Reader
+

Paginator is placed inside a nav element to indicate a navigation section. All of the paginator elements can be customized using templating however the default behavious is listed below.

+ +

First, previous, next and last page navigators elements with aria-label attributes referring to the aria.firstPageLabel, aria.prevPageLabel, aria.nextPageLabel and aria.lastPageLabel + properties of the locale API respectively.

+ +

Page links are also button elements with an aria-label attribute derived from the aria.pageLabel of the locale API. Current page is marked with aria-current set to "page" as well.

+ +

Current page report uses aria-live="polite" to instruct screen reader about the changes to the pagination state.

+ +

Rows per page dropdown internally uses a dropdown component, refer to the dropdown documentation for accessibility details. Additionally, the dropdown uses an aria-label + from the aria.rowsPerPage property of the locale API.

+ +

Jump to page input is an input element with an aria-label that refers to the aria.jumpToPage property of the locale API.

+ +
Keyboard Support
+
+ + + + + + + + + + + + + + + + + + + + + +
KeyFunction
tabMoves focus through the paginator elements.
enterExecutes the paginator element action.
spaceExecutes the paginator element action.
+
+ +
Rows Per Page Dropdown Keyboard Support
+

Refer to the dropdown documentation for more details about keyboard support.

+
+ +
Dependencies
+

None.

{