Skip to content

Commit

Permalink
fix: announcing next and previous button in pagination and pagination…
Browse files Browse the repository at this point in the history
…Nav (#16794)

* fix: announcing next and previous button in pagination and paginationNav

* fix: small fix
  • Loading branch information
riddhybansal authored Jun 17, 2024
1 parent d380f14 commit 10bf793
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/react/src/components/Pagination/Pagination.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,7 @@ const Pagination = React.forwardRef(function Pagination(
kind="ghost"
className={backButtonClasses}
label={backwardText}
aria-label={backwardText}
onClick={decrementPage}
ref={backBtnRef}>
<CaretLeft />
Expand All @@ -415,6 +416,7 @@ const Pagination = React.forwardRef(function Pagination(
kind="ghost"
className={forwardButtonClasses}
label={forwardText}
aria-label={forwardText}
onClick={incrementPage}
ref={forwardBtnRef}>
<CaretRight />
Expand Down
2 changes: 2 additions & 0 deletions packages/react/src/components/PaginationNav/PaginationNav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,7 @@ const PaginationNav = React.forwardRef<HTMLElement, PaginationNavProps>(
<ul className={`${prefix}--pagination-nav__list`}>
<DirectionButton
direction="backward"
aria-label={t('carbon.pagination-nav.previous')}
label={t('carbon.pagination-nav.previous')}
disabled={backwardButtonDisabled}
onClick={jumpToPrevious}
Expand Down Expand Up @@ -516,6 +517,7 @@ const PaginationNav = React.forwardRef<HTMLElement, PaginationNavProps>(

<DirectionButton
direction="forward"
aria-label={t('carbon.pagination-nav.next')}
label={t('carbon.pagination-nav.next')}
disabled={forwardButtonDisabled}
onClick={jumpToNext}
Expand Down

0 comments on commit 10bf793

Please sign in to comment.