From 7df8b4ce7bcf3502c162c29d842b44cf8e6e2e6c Mon Sep 17 00:00:00 2001 From: Ilza Medeiros Date: Thu, 8 Feb 2024 17:12:48 -0300 Subject: [PATCH 1/2] fix(@clayui/pagination): LPD-17368 Add aria-label on pagination picker to ideentify the combobox --- .../clay-pagination-bar/src/PaginationBarWithBasicItems.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/clay-pagination-bar/src/PaginationBarWithBasicItems.tsx b/packages/clay-pagination-bar/src/PaginationBarWithBasicItems.tsx index 2c086cef32..8cf8d08e63 100644 --- a/packages/clay-pagination-bar/src/PaginationBarWithBasicItems.tsx +++ b/packages/clay-pagination-bar/src/PaginationBarWithBasicItems.tsx @@ -105,6 +105,8 @@ interface IProps extends React.ComponentProps { * Use this property for i18n. */ labels?: { + itemsPerPagePickerAriaLabel?: string; + paginationResults: string; perPageItems: string; @@ -148,6 +150,7 @@ interface IProps extends React.ComponentProps { } const DEFAULT_LABELS = { + itemsPerPagePickerAriaLabel: 'Items Per Page', paginationResults: 'Showing {0} to {1} of {2}', perPageItems: '{0} items', selectPerPageItems: '{0} items', @@ -209,6 +212,8 @@ export const ClayPaginationBarWithBasicItems = ({ value: typeof active === 'undefined' ? activePage : active, }); + labels = {...DEFAULT_LABELS, ...labels}; + if (!activeDelta) { activeDelta = deltas[0]!.label; } @@ -230,6 +235,7 @@ export const ClayPaginationBarWithBasicItems = ({ Date: Thu, 8 Feb 2024 17:13:11 -0300 Subject: [PATCH 2/2] fix(@clayui/pagination): LPD-17368 Update snapshot --- .../src/__tests__/__snapshots__/index.tsx.snap | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/clay-pagination-bar/src/__tests__/__snapshots__/index.tsx.snap b/packages/clay-pagination-bar/src/__tests__/__snapshots__/index.tsx.snap index 4d1120d84e..1db8890707 100644 --- a/packages/clay-pagination-bar/src/__tests__/__snapshots__/index.tsx.snap +++ b/packages/clay-pagination-bar/src/__tests__/__snapshots__/index.tsx.snap @@ -13,6 +13,7 @@ exports[`ClayPaginationBar renders 1`] = ` aria-describedby="clay-id-1" aria-expanded="false" aria-haspopup="listbox" + aria-label="Items Per Page" class="dropdown-toggle btn btn-unstyled" role="combobox" tabindex="0"