Skip to content

Commit

Permalink
[material-ui][Pagination] Use correct aria-current value (#44753)
Browse files Browse the repository at this point in the history
Signed-off-by: Jack Laurence <[email protected]>
Co-authored-by: Albert Yu <[email protected]>
  • Loading branch information
jacklaurencegaray and mj12albert authored Dec 16, 2024
1 parent 3baba19 commit bc715f9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/mui-material/src/Pagination/Pagination.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe('<Pagination />', () => {

// 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);
});
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-material/src/usePagination/usePagination.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down

0 comments on commit bc715f9

Please sign in to comment.