-
-
Notifications
You must be signed in to change notification settings - Fork 7.1k
Improve pagination template accessibility with aria attributes and re… #9905
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,21 +1,21 @@ | ||
| <ul class="pager"> | ||
| {% if previous_url %} | ||
| <li class="previous"> | ||
| <a href="{{ previous_url }}">« Previous</a> | ||
| <a href="{{ previous_url }}" rel="prev" aria-label="Previous page">« Previous</a> | ||
| </li> | ||
| {% else %} | ||
| <li class="previous disabled"> | ||
| <a href="#">« Previous</a> | ||
| <li class="previous disabled" aria-disabled="true"> | ||
| <a href="#" tabindex="-1" aria-disabled="true">« Previous</a> | ||
|
Comment on lines
+7
to
+8
|
||
| </li> | ||
| {% endif %} | ||
|
|
||
| {% if next_url %} | ||
| <li class="next"> | ||
| <a href="{{ next_url }}">Next »</a> | ||
| <a href="{{ next_url }}" rel="next" aria-label="Next page">Next »</a> | ||
browniebroke marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| </li> | ||
| {% else %} | ||
| <li class="next disabled"> | ||
| <a href="#">Next »</a> | ||
| <li class="next disabled" aria-disabled="true"> | ||
| <a href="#" tabindex="-1" aria-disabled="true">Next »</a> | ||
|
Comment on lines
+17
to
+18
|
||
| </li> | ||
| {% endif %} | ||
| </ul> | ||
| </ul> | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new aria-label value ("Previous page") is inconsistent with the existing pagination template (numbers.html uses aria-label="Previous"). Consider using the same label across pagination templates (and reusing the existing visible wording) to keep screen reader output consistent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In
numbers.html, I think it's listing all pages number so "Previous" and "Next" are probably enough, but here I think "Previous page" is clearer, and more explicit.