Skip to content

Commit

Permalink
Fix previous button not working after latest page numbering changes
Browse files Browse the repository at this point in the history
  • Loading branch information
elboletaire committed Jun 7, 2024
1 parent 3019238 commit 1093fb7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/Pagination/Pagination.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -174,15 +174,15 @@ export const RoutedPagination = ({ maxButtons = 10, buttonProps, ...rest }: Pagi
<>
<Button
key='previous'
onClick={() => navigate(generatePath(path, { page: p, ...extraParams }))}
isDisabled={p === 0}
onClick={() => navigate(generatePath(path, { page: p - 1, ...extraParams }))}
isDisabled={p === 1}
{...buttonProps}
>
Previous
</Button>
<Button
key='next'
onClick={() => navigate(generatePath(path, { page: p + 2, ...extraParams }))}
onClick={() => navigate(generatePath(path, { page: p + 1, ...extraParams }))}
{...buttonProps}
>
Next
Expand Down

2 comments on commit 1093fb7

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.