Skip to content

Commit

Permalink
[front] Reset pagination when changing search (#9620)
Browse files Browse the repository at this point in the history
  • Loading branch information
tdraier authored Dec 23, 2024
1 parent cf507f8 commit c9cd748
Showing 1 changed file with 5 additions and 1 deletion.
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

0 comments on commit c9cd748

Please sign in to comment.