Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/DataTable/Pagination.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ function Pagination({
}: PaginationProps): JSX.Element {
const windowSize = useWindowSize();
const isRTL = useRTL(direction);
const shouldShow = windowSize.width && windowSize.width > SMALL;
const { minWindowWidth = SMALL } = paginationComponentOptions;
const windowWidth = windowSize.width;
const shouldShow = !minWindowWidth || (windowWidth && windowWidth > minWindowWidth);
// const isRTL = detectRTL(direction);
const numPages = getNumberOfPages(rowCount, rowsPerPage);
const lastIndex = currentPage * rowsPerPage;
Expand Down
4 changes: 4 additions & 0 deletions src/DataTable/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,10 @@ export interface TableStyles {

export interface PaginationOptions {
noRowsPerPage?: boolean;
// If non-null, the "rows per page" dropdown will be hidden when the window width is less than
// this value. SMALL == 599 is the default (if this property is undefined); pass `null` to always
// show the dropdown (useful for ensuring SSR matches client).
minWindowWidth?: number | null;
rowsPerPageText?: string;
rangeSeparatorText?: string;
selectAllRowsItem?: boolean;
Expand Down