From 8cd6007e589d33fd89a1ab2a93547b9977e274b2 Mon Sep 17 00:00:00 2001 From: Tyler Jones Date: Wed, 25 Oct 2023 17:25:06 -0400 Subject: [PATCH] Add `aria-disabled` to inactive pagination buttons (#3862) * Add `aria-disabled` to inactive pagination buttons (next/previous) * Add changeset --- .changeset/grumpy-clocks-sell.md | 5 +++++ src/DataTable/Pagination.tsx | 2 ++ 2 files changed, 7 insertions(+) create mode 100644 .changeset/grumpy-clocks-sell.md diff --git a/.changeset/grumpy-clocks-sell.md b/.changeset/grumpy-clocks-sell.md new file mode 100644 index 00000000000..0c3a965a89b --- /dev/null +++ b/.changeset/grumpy-clocks-sell.md @@ -0,0 +1,5 @@ +--- +'@primer/react': patch +--- + +Adds `aria-disabled` to inactive pagination buttons. diff --git a/src/DataTable/Pagination.tsx b/src/DataTable/Pagination.tsx index 2769a4e943e..9dc14038e50 100644 --- a/src/DataTable/Pagination.tsx +++ b/src/DataTable/Pagination.tsx @@ -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 @@ -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