Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[front] Reset pagination when changing search #9620

Merged
merged 1 commit into from
Dec 23, 2024
Merged
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
6 changes: 5 additions & 1 deletion front/components/members/MembersList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import type {
} from "@dust-tt/types";
import type { CellContext, PaginationState } from "@tanstack/react-table";
import _ from "lodash";
import React, { useMemo, useState } from "react";
import React, { useEffect, useMemo, useState } from "react";

import { displayRole, ROLES_DATA } from "@app/components/members/Roles";
import { ChangeMemberModal } from "@app/components/workspace/ChangeMemberModal";
Expand Down Expand Up @@ -50,6 +50,10 @@ export function MembersList({
pageIndex: 0,
pageSize: 25,
});
useEffect(() => {
setPagination({ pageIndex: 0, pageSize: 25 });
}, [searchText, setPagination]);

const [selectedMember, setSelectedMember] =
useState<UserTypeWithWorkspaces | null>(null);
const {
Expand Down
Loading