forked from github/plane
fix: sort order in the same list for Kanban (#3651)
* fixing kanban dnd by stooping the modification of the original array by spreading to change the array reference * fix sort order in the same list * minor change in condition
This commit is contained in:
parent
1bf06821bb
commit
83139989c2
@ -67,10 +67,13 @@ export const handleDragDrop = async (
|
|||||||
|
|
||||||
let updateIssue: any = {};
|
let updateIssue: any = {};
|
||||||
|
|
||||||
const sourceColumnId = (source?.droppableId && source?.droppableId.split("__")) || null;
|
const sourceDroppableId = source?.droppableId;
|
||||||
const destinationColumnId = (destination?.droppableId && destination?.droppableId.split("__")) || null;
|
const destinationDroppableId = destination?.droppableId;
|
||||||
|
|
||||||
if (!sourceColumnId || !destinationColumnId) return;
|
const sourceColumnId = (sourceDroppableId && sourceDroppableId.split("__")) || null;
|
||||||
|
const destinationColumnId = (destinationDroppableId && destinationDroppableId.split("__")) || null;
|
||||||
|
|
||||||
|
if (!sourceColumnId || !destinationColumnId || !sourceDroppableId || !destinationDroppableId) return;
|
||||||
|
|
||||||
const sourceGroupByColumnId = sourceColumnId[0] || null;
|
const sourceGroupByColumnId = sourceColumnId[0] || null;
|
||||||
const destinationGroupByColumnId = destinationColumnId[0] || null;
|
const destinationGroupByColumnId = destinationColumnId[0] || null;
|
||||||
@ -123,7 +126,11 @@ export const handleDragDrop = async (
|
|||||||
// for both horizontal and vertical dnd
|
// for both horizontal and vertical dnd
|
||||||
updateIssue = {
|
updateIssue = {
|
||||||
...updateIssue,
|
...updateIssue,
|
||||||
...handleSortOrder(destinationIssues, destination.index, issueMap),
|
...handleSortOrder(
|
||||||
|
sourceDroppableId === destinationDroppableId ? sourceIssues : destinationIssues,
|
||||||
|
destination.index,
|
||||||
|
issueMap
|
||||||
|
),
|
||||||
};
|
};
|
||||||
|
|
||||||
if (subGroupBy && sourceSubGroupByColumnId && destinationSubGroupByColumnId) {
|
if (subGroupBy && sourceSubGroupByColumnId && destinationSubGroupByColumnId) {
|
||||||
|
Loading…
Reference in New Issue
Block a user