Skip to content

Commit

Permalink
Add aria-disabled to inactive pagination buttons (#3862)
Browse files Browse the repository at this point in the history
* Add `aria-disabled` to inactive pagination buttons (next/previous)

* Add changeset
  • Loading branch information
TylerJDev authored Oct 25, 2023
1 parent add9689 commit 8cd6007
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/grumpy-clocks-sell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@primer/react': patch
---

Adds `aria-disabled` to inactive pagination buttons.
2 changes: 2 additions & 0 deletions src/DataTable/Pagination.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ export function Pagination({
className="TablePaginationAction"
type="button"
data-has-page={hasPreviousPage ? true : undefined}
aria-disabled={!hasPreviousPage ? true : undefined}
onClick={() => {
if (!hasPreviousPage) {
return
Expand Down Expand Up @@ -306,6 +307,7 @@ export function Pagination({
className="TablePaginationAction"
type="button"
data-has-page={hasNextPage ? true : undefined}
aria-disabled={!hasNextPage ? true : undefined}
onClick={() => {
if (!hasNextPage) {
return
Expand Down

0 comments on commit 8cd6007

Please sign in to comment.