Skip to content

Commit

Permalink
[sparkle] fix: Don't set initial pagination state, always reset to fi…
Browse files Browse the repository at this point in the history
…rst page (#7560)
  • Loading branch information
tdraier authored Sep 20, 2024
1 parent 27ed3ee commit 0d0d599
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions sparkle/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion sparkle/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dust-tt/sparkle",
"version": "0.2.243",
"version": "0.2.244",
"scripts": {
"build": "rm -rf dist && npm run tailwind && npm run build:esm && npm run build:cjs",
"tailwind": "tailwindcss -i ./src/styles/tailwind.css -o dist/sparkle.css",
Expand Down
4 changes: 2 additions & 2 deletions sparkle/src/components/DataTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ export function DataTable<TData extends TBaseData>({
const [columnFilters, setColumnFilters] = useState<ColumnFiltersState>([]);

const isServerSidePagination = !!totalRowCount && totalRowCount > data.length;
const isClientSideSortingEnabled = !isServerSideSorting && !isServerSidePagination;
const isClientSideSortingEnabled =
!isServerSideSorting && !isServerSidePagination;

const onPaginationChange =
pagination && setPagination
Expand Down Expand Up @@ -137,7 +138,6 @@ export function DataTable<TData extends TBaseData>({
pagination,
},
initialState: {
pagination,
sorting,
},
onPaginationChange,
Expand Down

0 comments on commit 0d0d599

Please sign in to comment.