Skip to content

Commit

Permalink
Accessibility label and role for pagination arrows. (#7252)
Browse files Browse the repository at this point in the history
  • Loading branch information
isoos authored Dec 4, 2023
1 parent 8b2e418 commit c211529
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 16 deletions.
6 changes: 6 additions & 0 deletions app/lib/frontend/templates/views/shared/pagination.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ d.Node paginationNode(PageLinks links) {
: null,
rel: 'prev nofollow',
child: d.span(text: '«'),
attributes: {
'aria-label': 'previous page',
},
),
),

Expand Down Expand Up @@ -56,6 +59,9 @@ d.Node paginationNode(PageLinks links) {
: null,
rel: 'next nofollow',
child: d.span(text: '»'),
attributes: {
'aria-label': 'next page',
},
),
),
],
Expand Down
4 changes: 2 additions & 2 deletions app/test/frontend/golden/pagination_first.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<fragment>
<ul class="pagination">
<li class="-disabled">
<a rel="prev nofollow">
<a rel="prev nofollow" aria-label="previous page">
<span>«</span>
</a>
</li>
Expand Down Expand Up @@ -36,7 +36,7 @@
</a>
</li>
<li>
<a href="/packages?page=2" rel="next nofollow">
<a href="/packages?page=2" rel="next nofollow" aria-label="next page">
<span>»</span>
</a>
</li>
Expand Down
4 changes: 2 additions & 2 deletions app/test/frontend/golden/pagination_last.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<fragment>
<ul class="pagination">
<li>
<a href="/packages?page=9" rel="prev nofollow">
<a href="/packages?page=9" rel="prev nofollow" aria-label="previous page">
<span>«</span>
</a>
</li>
Expand Down Expand Up @@ -36,7 +36,7 @@
</a>
</li>
<li class="-disabled">
<a rel="next nofollow">
<a rel="next nofollow" aria-label="next page">
<span>»</span>
</a>
</li>
Expand Down
4 changes: 2 additions & 2 deletions app/test/frontend/golden/pagination_middle.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<fragment>
<ul class="pagination">
<li>
<a href="/packages?page=9" rel="prev nofollow">
<a href="/packages?page=9" rel="prev nofollow" aria-label="previous page">
<span>«</span>
</a>
</li>
Expand Down Expand Up @@ -61,7 +61,7 @@
</a>
</li>
<li>
<a href="/packages?page=11" rel="next nofollow">
<a href="/packages?page=11" rel="next nofollow" aria-label="next page">
<span>»</span>
</a>
</li>
Expand Down
4 changes: 2 additions & 2 deletions app/test/frontend/golden/pagination_single.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<fragment>
<ul class="pagination">
<li class="-disabled">
<a rel="prev nofollow">
<a rel="prev nofollow" aria-label="previous page">
<span>«</span>
</a>
</li>
Expand All @@ -11,7 +11,7 @@
</a>
</li>
<li class="-disabled">
<a rel="next nofollow">
<a rel="next nofollow" aria-label="next page">
<span>»</span>
</a>
</li>
Expand Down
4 changes: 2 additions & 2 deletions app/test/frontend/golden/pkg_index_page.html
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ <h3 class="packages-title">
</div>
<ul class="pagination">
<li class="-disabled">
<a rel="prev nofollow">
<a rel="prev nofollow" aria-label="previous page">
<span>«</span>
</a>
</li>
Expand All @@ -600,7 +600,7 @@ <h3 class="packages-title">
</a>
</li>
<li class="-disabled">
<a rel="next nofollow">
<a rel="next nofollow" aria-label="next page">
<span>»</span>
</a>
</li>
Expand Down
4 changes: 2 additions & 2 deletions app/test/frontend/golden/publisher_packages_page.html
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ <h3 class="packages-title">
</div>
<ul class="pagination">
<li class="-disabled">
<a rel="prev nofollow">
<a rel="prev nofollow" aria-label="previous page">
<span>«</span>
</a>
</li>
Expand All @@ -350,7 +350,7 @@ <h3 class="packages-title">
</a>
</li>
<li class="-disabled">
<a rel="next nofollow">
<a rel="next nofollow" aria-label="next page">
<span>»</span>
</a>
</li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ <h3 class="packages-title">
</div>
<ul class="pagination">
<li class="-disabled">
<a rel="prev nofollow">
<a rel="prev nofollow" aria-label="previous page">
<span>«</span>
</a>
</li>
Expand All @@ -356,7 +356,7 @@ <h3 class="packages-title">
</a>
</li>
<li class="-disabled">
<a rel="next nofollow">
<a rel="next nofollow" aria-label="next page">
<span>»</span>
</a>
</li>
Expand Down
4 changes: 2 additions & 2 deletions app/test/frontend/golden/search_page.html
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@ <h3 class="packages-title">
</div>
<ul class="pagination">
<li class="-disabled">
<a rel="prev nofollow">
<a rel="prev nofollow" aria-label="previous page">
<span>«</span>
</a>
</li>
Expand Down Expand Up @@ -613,7 +613,7 @@ <h3 class="packages-title">
</a>
</li>
<li>
<a href="/packages?q=foobar&amp;sort=top&amp;page=2" rel="next nofollow">
<a href="/packages?q=foobar&amp;sort=top&amp;page=2" rel="next nofollow" aria-label="next page">
<span>»</span>
</a>
</li>
Expand Down

0 comments on commit c211529

Please sign in to comment.