Skip to content

Commit

Permalink
Merge branch 'r/table-paginator-arrow-keys-bug' into r/overflow-conta…
Browse files Browse the repository at this point in the history
…iner-without-new-algorithm
  • Loading branch information
r100-stack committed Oct 14, 2024
2 parents fb18559 + 4fed729 commit 27fbb21
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/tidy-poems-buy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@itwin/itwinui-react': patch
---

Fixed arrow keys page navigation in `TablePaginator`.
3 changes: 2 additions & 1 deletion packages/itwinui-react/src/core/Table/TablePaginator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {
} from '../../utils/index.js';
import type { CommonProps } from '../../utils/index.js';
import type { TablePaginatorRendererProps } from './Table.js';
import { styles } from '../../styles.js';

const defaultLocalization = {
pageSizeLabel: (size: number) => `${size} per page`,
Expand Down Expand Up @@ -159,7 +160,7 @@ export const TablePaginator = (props: TablePaginatorProps) => {
if (isMounted.current && needFocus.current) {
const buttonToFocus = Array.from(
pageListRef.current?.querySelectorAll(
'.iui-table-paginator-page-button',
`.${styles['iui-table-paginator-page-button']}`,
) ?? [],
).find((el) => el.textContent?.trim() === (focusedIndex + 1).toString());
(buttonToFocus as HTMLButtonElement | undefined)?.focus();
Expand Down

0 comments on commit 27fbb21

Please sign in to comment.