HiveBrain v1.2.0
Get Started
← Back to all entries
patternhtmlMinor

WAI-ARIA and Pagination

Submitted by: @import:stackexchange-codereview··
0
Viewed 0 times
andpaginationariawai

Problem

I would like to get some advice on WAI-ARIA markup I have added to my paginated post navigation.

Does this look correct, am I missing anything?

Should anything be added/removed to the current page link (#2)?

Also, curious on my "Page Count" and "View All" sections what if anything can be added to make it more ARIA-friendly.






Page 2 of 4



«



-
1


2


-
3


-
4



»





View All




Solution

If you’re using HTML5 ` element, it’s not necessary to apply a role of ‘navigation’ – certain HTML elements inherently pass their relevant roles to the accessibility API. If you were wrapping the navigation menu in a , for example, then you’d need to apply a role of ‘navigation’.

Role="menubar" has been correctly applied to the element, as has role="menuitem" to the tags.

I would suggest applying a
role="none" to each
  • element; otherwise this could confuse some users of assistive technologies since listitems and menuitems would be interspersed with each other.



Might be an idea to provide an aria-label to the
with role="menubar"; used to help people understand the menu purpose and uniquely identify it from other menubars on the page.

Can also apply a
tabindex="0" to first and last elements – gives keyboard focus to link and makes a part of the tab order of the page. Alternatively, give a tabindex="-1" to make `s focusable but not part of the tab order of the page.

Context

StackExchange Code Review Q#124586, answer score: 4

Revisions (0)

No revisions yet.