diff --git a/src/app/deals/hooks/useDnd.ts b/src/app/deals/hooks/useDnd.ts index 342d06e..cbf68a2 100644 --- a/src/app/deals/hooks/useDnd.ts +++ b/src/app/deals/hooks/useDnd.ts @@ -108,7 +108,8 @@ const useDnd = (props: Props) => { const getDropTarget = ( overId: string | number, activeDealId: number, - activeStatusId: number + activeStatusId: number, + isOnDragEnd: boolean = false ) => { if (typeof overId === "string") { return { @@ -120,7 +121,7 @@ const useDnd = (props: Props) => { const overDealId = Number(overId); const overStatusId = getStatusByDealId(overDealId)?.id; - if (!overStatusId || activeDealId === overDealId) { + if (!overStatusId || (!isOnDragEnd && activeDealId === overDealId)) { return { overStatusId: undefined, newLexorank: undefined }; } @@ -190,7 +191,8 @@ const useDnd = (props: Props) => { const { overStatusId, newLexorank } = getDropTarget( over.id, activeDealId, - activeStatusId + activeStatusId, + true ); if (!overStatusId) return;