forked from github/plane
fixing kanban dnd by stooping the modification of the original array by spreading to change the array reference (#3646)
This commit is contained in:
parent
06496ff0f0
commit
f64284f6a0
@ -101,9 +101,13 @@ export const handleDragDrop = async (
|
||||
else return await store?.removeIssue(workspaceSlug, projectId, removed);
|
||||
}
|
||||
} else {
|
||||
const sourceIssues = subGroupBy
|
||||
? (issueWithIds as TSubGroupedIssues)[sourceSubGroupByColumnId][sourceGroupByColumnId]
|
||||
: (issueWithIds as TGroupedIssues)[sourceGroupByColumnId];
|
||||
//spreading the array to stop changing the original reference
|
||||
//since we are removing an id from array further down
|
||||
const sourceIssues = [
|
||||
...(subGroupBy
|
||||
? (issueWithIds as TSubGroupedIssues)[sourceSubGroupByColumnId][sourceGroupByColumnId]
|
||||
: (issueWithIds as TGroupedIssues)[sourceGroupByColumnId]),
|
||||
];
|
||||
const destinationIssues = subGroupBy
|
||||
? (issueWithIds as TSubGroupedIssues)[sourceSubGroupByColumnId][destinationGroupByColumnId]
|
||||
: (issueWithIds as TGroupedIssues)[destinationGroupByColumnId];
|
||||
|
Loading…
Reference in New Issue
Block a user