Skip to content

Commit 9f4b846

Browse files
[material-ui][Pagination] Update getItemAriaLabel page param type (#43399)
1 parent 7b72eb3 commit 9f4b846

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

docs/pages/material-ui/api/pagination.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"getItemAriaLabel": {
1616
"type": { "name": "func" },
1717
"signature": {
18-
"type": "function(type: string, page: number, selected: bool) => string",
18+
"type": "function(type: string, page: number | null, selected: boolean) => string",
1919
"describedArgs": ["type", "page", "selected"]
2020
}
2121
},

packages/mui-material/src/Pagination/Pagination.d.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,15 @@ export interface PaginationProps
4242
*
4343
* For localization purposes, you can use the provided [translations](/material-ui/guides/localization/).
4444
* @param {string} type The link or button type to format ('page' | 'first' | 'last' | 'next' | 'previous' | 'start-ellipsis' | 'end-ellipsis'). Defaults to 'page'.
45-
* @param {number} page The page number to format.
46-
* @param {bool} selected If true, the current page is selected.
45+
* @param {number | null} page The page number to format.
46+
* @param {boolean} selected If true, the current page is selected.
4747
* @returns {string}
4848
*/
49-
getItemAriaLabel?: (type: UsePaginationItem['type'], page: number, selected: boolean) => string;
49+
getItemAriaLabel?: (
50+
type: UsePaginationItem['type'],
51+
page: UsePaginationItem['page'],
52+
selected: UsePaginationItem['selected'],
53+
) => string;
5054

5155
/**
5256
* Render the item.

packages/mui-material/src/Pagination/Pagination.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,8 @@ Pagination.propTypes /* remove-proptypes */ = {
176176
*
177177
* For localization purposes, you can use the provided [translations](/material-ui/guides/localization/).
178178
* @param {string} type The link or button type to format ('page' | 'first' | 'last' | 'next' | 'previous' | 'start-ellipsis' | 'end-ellipsis'). Defaults to 'page'.
179-
* @param {number} page The page number to format.
180-
* @param {bool} selected If true, the current page is selected.
179+
* @param {number | null} page The page number to format.
180+
* @param {boolean} selected If true, the current page is selected.
181181
* @returns {string}
182182
*/
183183
getItemAriaLabel: PropTypes.func,

0 commit comments

Comments
 (0)