Skip to content
Merged
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
fix: prevent UI from jumping around when selecting workspaces
  • Loading branch information
Parkreiner committed Dec 21, 2023
commit 2214a479a0778ce6d587de14005d2313f58a5072
6 changes: 6 additions & 0 deletions site/src/components/PaginationWidget/PaginationHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,18 @@ type PaginationHeaderProps = {
limit: number;
totalRecords: number | undefined;
currentOffsetStart: number | undefined;

// Temporary escape hatch until Workspaces can be switched over to using
// PaginationContainer
className?: string;
};

export const PaginationHeader: FC<PaginationHeaderProps> = ({
paginationUnitLabel,
limit,
totalRecords,
currentOffsetStart,
className,
}) => {
const theme = useTheme();

Expand All @@ -32,6 +37,7 @@ export const PaginationHeader: FC<PaginationHeaderProps> = ({
color: theme.palette.text.primary,
},
}}
className={className}
>
{totalRecords !== undefined ? (
<>
Expand Down
1 change: 1 addition & 0 deletions site/src/pages/WorkspacesPage/WorkspacesPageView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ export const WorkspacesPageView = ({
limit={limit}
totalRecords={count}
currentOffsetStart={(page - 1) * limit + 1}
css={{ paddingBottom: "0" }}
/>
)}
</TableToolbar>
Expand Down