From bc715f9e44ea22c5146fe8ecd5231d4490a63bd9 Mon Sep 17 00:00:00 2001 From: Jack Laurence Date: Mon, 16 Dec 2024 08:12:54 +0100 Subject: [PATCH] [material-ui][Pagination] Use correct `aria-current` value (#44753) Signed-off-by: Jack Laurence Co-authored-by: Albert Yu --- packages/mui-material/src/Pagination/Pagination.test.js | 2 +- packages/mui-material/src/usePagination/usePagination.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/mui-material/src/Pagination/Pagination.test.js b/packages/mui-material/src/Pagination/Pagination.test.js index 44d778114b3284..ea4b1f451a636f 100644 --- a/packages/mui-material/src/Pagination/Pagination.test.js +++ b/packages/mui-material/src/Pagination/Pagination.test.js @@ -33,7 +33,7 @@ describe('', () => { // previous, page 1 const [, page1] = getAllByRole('button'); - expect(page1).to.have.attribute('aria-current', 'true'); + expect(page1).to.have.attribute('aria-current', 'page'); // verifying no regression from previous bug where `page` wasn't intercepted expect(container.querySelector('[page]')).to.equal(null); }); diff --git a/packages/mui-material/src/usePagination/usePagination.js b/packages/mui-material/src/usePagination/usePagination.js index d76cb58e6be8e9..60f00c5ca9b022 100644 --- a/packages/mui-material/src/usePagination/usePagination.js +++ b/packages/mui-material/src/usePagination/usePagination.js @@ -124,7 +124,7 @@ export default function usePagination(props = {}) { page: item, selected: item === page, disabled, - 'aria-current': item === page ? 'true' : undefined, + 'aria-current': item === page ? 'page' : undefined, } : { onClick: (event) => {