fix: fixed deal dragging end
This commit is contained in:
@ -108,7 +108,8 @@ const useDnd = (props: Props) => {
|
|||||||
const getDropTarget = (
|
const getDropTarget = (
|
||||||
overId: string | number,
|
overId: string | number,
|
||||||
activeDealId: number,
|
activeDealId: number,
|
||||||
activeStatusId: number
|
activeStatusId: number,
|
||||||
|
isOnDragEnd: boolean = false
|
||||||
) => {
|
) => {
|
||||||
if (typeof overId === "string") {
|
if (typeof overId === "string") {
|
||||||
return {
|
return {
|
||||||
@ -120,7 +121,7 @@ const useDnd = (props: Props) => {
|
|||||||
const overDealId = Number(overId);
|
const overDealId = Number(overId);
|
||||||
const overStatusId = getStatusByDealId(overDealId)?.id;
|
const overStatusId = getStatusByDealId(overDealId)?.id;
|
||||||
|
|
||||||
if (!overStatusId || activeDealId === overDealId) {
|
if (!overStatusId || (!isOnDragEnd && activeDealId === overDealId)) {
|
||||||
return { overStatusId: undefined, newLexorank: undefined };
|
return { overStatusId: undefined, newLexorank: undefined };
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -190,7 +191,8 @@ const useDnd = (props: Props) => {
|
|||||||
const { overStatusId, newLexorank } = getDropTarget(
|
const { overStatusId, newLexorank } = getDropTarget(
|
||||||
over.id,
|
over.id,
|
||||||
activeDealId,
|
activeDealId,
|
||||||
activeStatusId
|
activeStatusId,
|
||||||
|
true
|
||||||
);
|
);
|
||||||
if (!overStatusId) return;
|
if (!overStatusId) return;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user