-
-
Notifications
You must be signed in to change notification settings - Fork 79k
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
Improve documentation pagination accessibility #26355
Improve documentation pagination accessibility #26355
Conversation
docs/4.1/components/pagination.md
Outdated
@@ -15,36 +15,34 @@ In addition, as pages likely have more than one such navigation section, it's ad | |||
{% capture example %} | |||
<nav aria-label="Page navigation example"> | |||
<ul class="pagination"> | |||
<li class="page-item"><a class="page-link" href="#">Previous</a></li> | |||
<li class="page-item"><a class="page-link" href="#" rel="prev">Previous</a></li> |
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.
only information on these rel="..."
attributes being of some use i came across in the past related to them being used on <link rel="..." ...>
elements in the <head>
. e.g. https://support.google.com/webmasters/answer/1663744?hl=en
if authors want to add this to their code, cool (assuming the attributes on actual links, rather than <link...>
elements, does anything). but i don't think it's necessary for our example code
docs/4.1/components/pagination.md
Outdated
<li class="page-item"><a class="page-link" href="#">1</a></li> | ||
<li class="page-item"><a class="page-link" href="#">2</a></li> | ||
<li class="page-item"><a class="page-link" href="#">3</a></li> | ||
<li class="page-item"><a class="page-link" href="#">Next</a></li> | ||
<li class="page-item"><a class="page-link" href="#" rel="next">Next</a></li> |
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.
see above
docs/4.1/components/pagination.md
Outdated
|
||
{% capture example %} | ||
<nav aria-label="Page navigation example"> | ||
<ul class="pagination"> | ||
<li class="page-item"> | ||
<a class="page-link" href="#" aria-label="Previous"> | ||
<a class="page-link" href="#" rel="prev" aria-label="Previous"> |
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.
see above
docs/4.1/components/pagination.md
Outdated
</a> | ||
</li> | ||
<li class="page-item"><a class="page-link" href="#">1</a></li> | ||
<li class="page-item"><a class="page-link" href="#">2</a></li> | ||
<li class="page-item"><a class="page-link" href="#">3</a></li> | ||
<li class="page-item"> | ||
<a class="page-link" href="#" aria-label="Next"> | ||
<a class="page-link" href="#" rel="next" aria-label="Next"> |
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.
see above
docs/4.1/components/pagination.md
Outdated
@@ -61,16 +59,16 @@ While the `.disabled` class uses `pointer-events: none` to _try_ to disable the | |||
{% capture example %} | |||
<nav aria-label="..."> | |||
<ul class="pagination"> | |||
<li class="page-item disabled"> | |||
<a class="page-link" href="#" tabindex="-1">Previous</a> | |||
<li class="page-item disabled" aria-disabled="true"> |
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.
would make more sense to add aria-disabled="true"
to the actual link
docs/4.1/components/pagination.md
Outdated
</li> | ||
<li class="page-item"><a class="page-link" href="#">1</a></li> | ||
<li class="page-item"><a class="page-link" href="#">2</a></li> | ||
<li class="page-item"><a class="page-link" href="#">3</a></li> | ||
<li class="page-item"> | ||
<a class="page-link" href="#">Next</a> | ||
<a class="page-link" href="#" rel="next">Next</a> |
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.
see above
docs/4.1/components/pagination.md
Outdated
<li class="page-item disabled"> | ||
<a class="page-link" href="#" tabindex="-1">Previous</a> | ||
<li class="page-item disabled" aria-disabled="true"> | ||
<a class="page-link" href="#" rel="prev" tabindex="-1">Previous</a> |
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.
see above
docs/4.1/components/pagination.md
Outdated
</li> | ||
<li class="page-item"><a class="page-link" href="#">1</a></li> | ||
<li class="page-item"><a class="page-link" href="#">2</a></li> | ||
<li class="page-item"><a class="page-link" href="#">3</a></li> | ||
<li class="page-item"> | ||
<a class="page-link" href="#">Next</a> | ||
<a class="page-link" href="#" rel="next">Next</a> |
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.
see above
docs/4.1/components/pagination.md
Outdated
@@ -82,19 +80,19 @@ You can optionally swap out active or disabled anchors for `<span>`, or omit the | |||
{% capture example %} | |||
<nav aria-label="..."> | |||
<ul class="pagination"> | |||
<li class="page-item disabled"> | |||
<li class="page-item disabled" aria-disabled="true"> |
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.
as there's nothing focusable nor operable inside here, aria-disabled
is mostly useless here
docs/4.1/components/pagination.md
Outdated
@@ -138,14 +142,14 @@ Change the alignment of pagination components with [flexbox utilities]({{ site.b | |||
{% capture example %} | |||
<nav aria-label="Page navigation example"> | |||
<ul class="pagination justify-content-center"> | |||
<li class="page-item disabled"> | |||
<a class="page-link" href="#" tabindex="-1">Previous</a> | |||
<li class="page-item disabled" aria-disabled="true"> |
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.
would make more sense to add aria-disabled="true"
to the actual link
5babc0e
to
944a05c
Compare
Feedback addressed, please take another look I added |
Punting on this for v4.2 since I'm unsure of its status and we're hoping to launch v4.1.3 next week for some timely quality of life improvements and bug fixes. |
@patrickhlauke Can you review and see if this is mergeable? |
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.
LGTM
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.
LGTM
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.
LGTM
(crikey, apologies for the multiple messages...was trying to combat github's hickup this morning, and thought they hadn't actually gone through) |
- Remove `.sr-only` span for previous/next page, there is already`aria-label` - Add `aria-disabled="true"` and `aria-current="page"`
944a05c
to
29783e0
Compare
@patrickhlauke, I know this thing is quite outdated, but still :) Wouldn’t it be easier to solve by removing a single <li><a>1</a></li>
<li><a href>2</a></li>
<li><a href>3</a></li> |
Fixes #22009:
Addrel="prev"
andrel="next"
, also good for SEO!.sr-only
span for previous/next page, there is alreadyaria-label
aria-disabled="true"
andaria-current="page"
Also fix the active state on the Sizing section, the current page number was using the disabled look, it should be the active look instead.