Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lot of accessibility issues #429

Open
mellis481 opened this issue Jul 26, 2022 · 1 comment
Open

Lot of accessibility issues #429

mellis481 opened this issue Jul 26, 2022 · 1 comment

Comments

@mellis481
Copy link

Certain implementation decisions that were made for the pagination component have resulted in some serious inaccessibility issues. These include:

  • The programmatic label for all pager buttons uses the title attribute which is sub-optimal. aria-label is the best attribute to use as it works with more screen readers.
  • The programmatic label for page number pager buttons only includes the page number itself and cannot be changed so screen readers will only ever announce eg. "2" instead of something more helpful like "Page 2".
  • Since a pagination component includes navigation elements, it should necessarily be wrapped in a nav element with appropriate programmatic label (eg. <nav aria-label=”pagination”>).
  • The active page is not identified (using aria-current="page") and is, therefore, not announced by screen readers.
  • Instead of having the focusable/actionable pager elements be the anchor or button within each <li> element, the focusable elements in the Pagination component are the <li> elements. This results in the following issues:
    • a suboptimal screen reader UX because, when an element is focused, a screen reader will announce “clickable item 2” instead of something more helpful like "page 2 link".
    • the focusable element is only actionable via the ENTER key only rather than the SPACE and ENTER keys.
    • using UP/DOWN keys has unexpected/undesirable results.

For reference, here is a good example of an accessible pagination component.

@SalahAdDin
Copy link

SalahAdDin commented Aug 26, 2022

Certain implementation decisions that were made for the pagination component have resulted in some serious inaccessibility issues. These include:

  • The programmatic label for all pager buttons uses the title attribute which is sub-optimal. aria-label is the best attribute to use as it works with more screen readers.

  • The programmatic label for page number pager buttons only includes the page number itself and cannot be changed so screen readers will only ever announce eg. "2" instead of something more helpful like "Page 2".

  • Since a pagination component includes navigation elements, it should necessarily be wrapped in a nav element with an appropriate programmatic label (eg. <nav aria-label=”pagination”>).

  • The active page is not identified (using aria-current="page") and is, therefore, not announced by screen readers.

  • Instead of having the focusable/actionable pager elements be the anchor or button within each <li> element, the focusable elements in the Pagination component are the <li> elements. This results in the following issues:

    • a suboptimal screen reader UX because, when an element is focused, a screen reader will announce “clickable item 2” instead of something more helpful like "page 2 link".
    • the focusable element is only actionable via the ENTER key only rather than the SPACE and ENTER keys.
    • using UP/DOWN keys has unexpected/undesirable results.

For reference, here is a good example of an accessible pagination component.

Is this library even maintained nowadays?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants