Skip to content

Commit

Permalink
Merge pull request #1482 from Availity/docs/table-sorting
Browse files Browse the repository at this point in the history
docs(table): fix broken pagination when sorting in examples
  • Loading branch information
gregmartDOTin authored Nov 1, 2024
2 parents 7c58410 + c48c09f commit 2d77575
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions docusaurus/docs/components/table/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ const Example = () => (
{({ instance }) => (
<Pagination
itemsPerPage={instance.state.pageSize}
page={instance.currentPage}
page={instance.state.pageIndex - 1 }
onPageChange={(page: number) => {
const { gotoPage } = instance;
gotoPage(page - 1);
Expand Down Expand Up @@ -885,7 +885,7 @@ const Example = () => (
{({ instance }) => (
<Pagination
itemsPerPage={instance.state.pageSize}
page={instance.currentPage}
page={instance.state.pageIndex + 1 }
onPageChange={(page: number) => {
const { gotoPage } = instance;
gotoPage(page - 1);
Expand Down Expand Up @@ -974,7 +974,7 @@ const Example = () : JSX.Element => (
{({ instance }) => (
<Pagination
itemsPerPage={instance.state.pageSize}
page={instance.currentPage}
page={instance.state.pageIndex + 1}
onPageChange={(page: number) => {
const { gotoPage } = instance;
gotoPage(page - 1);
Expand Down
4 changes: 2 additions & 2 deletions docusaurus/docs/components/table/tableControls.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ const Example = () : JSX.Element => (
{({ instance }) => (
<Pagination
itemsPerPage={instance.state.pageSize}
page={instance.currentPage}
page={instance.state.pageIndex + 1}
onPageChange={(page: number) => {
const { gotoPage } = instance;
gotoPage(page - 1);
Expand Down Expand Up @@ -193,7 +193,7 @@ Below is an example of how to configure it (client-size pagination).
{({ instance }) => (
<Pagination
itemsPerPage={instance.state.pageSize}
page={instance.currentPage}
page={instance.state.pageIndex + 1}
onPageChange={(page: number) => {
const { gotoPage } = instance;
gotoPage(page - 1);
Expand Down
2 changes: 1 addition & 1 deletion packages/table/src/Table.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ const WithControlsStory = ({ sortable, selectable, columns, data, headerProps, b
{({ instance }) => (
<Pagination
itemsPerPage={instance.state.pageSize}
page={instance.currentPage}
page={instance.state.pageIndex + 1}
onPageChange={(page: number) => {
const { gotoPage } = instance;
gotoPage(page - 1);
Expand Down

0 comments on commit 2d77575

Please sign in to comment.