Skip to content

Commit

Permalink
Disable virtualization in UsersList
Browse files Browse the repository at this point in the history
ref DEV-1788
  • Loading branch information
louischan-oursky committed Aug 20, 2024
2 parents 8927ca8 + ccb0add commit 93cde71
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions portal/src/graphql/adminapi/UsersList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
PersonaSize,
Text,
MessageBar,
IListProps,
} from "@fluentui/react";
import { Context, FormattedMessage } from "@oursky/react-messageformat";
import { Link, useParams } from "react-router-dom";
Expand All @@ -35,6 +36,10 @@ import TextCell from "../../components/roles-and-groups/list/common/TextCell";
import ActionButtonCell from "../../components/roles-and-groups/list/common/ActionButtonCell";
import BaseCell from "../../components/roles-and-groups/list/common/BaseCell";

function onShouldVirtualize(_: IListProps): boolean {
return false;
}

interface UsersListProps {
className?: string;
isSearch: boolean;
Expand Down Expand Up @@ -460,6 +465,8 @@ const UsersList: React.VFC<UsersListProps> = function UsersList(props) {
layoutMode={DetailsListLayoutMode.justified}
columns={columns}
items={items}
// UserList always render fixed number of items, which is not infinite scroll, so no need virtualization
onShouldVirtualize={onShouldVirtualize}
/>
</div>
{!isSearch ? (
Expand Down

0 comments on commit 93cde71

Please sign in to comment.