Skip to content

Commit

Permalink
Merge pull request #696 from sudhanshutech/bug/transferlist
Browse files Browse the repository at this point in the history
[bug fix bug in unassign items in transferList component
  • Loading branch information
sudhanshutech authored Jul 31, 2024
2 parents 0e4c6d7 + d338e66 commit b9a302e
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/custom/TransferModal/TransferList/TransferList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,8 @@ function TransferList({

React.useEffect(() => {
assignedData(right);
const idsToRemove = new Set(right.map((item: { id: number }) => item.id));
const filteredLeft = assignableData.filter((item) => !idsToRemove.has(item.id));
setLeft(filteredLeft);
}, [right, assignableData, assignedData]);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [right]);

React.useEffect(() => {
const handleScroll = (entries: IntersectionObserverEntry[]) => {
Expand Down

0 comments on commit b9a302e

Please sign in to comment.