@ -6,11 +6,15 @@ export const getDraggedRecordPosition = (
|
|||||||
): number => {
|
): number => {
|
||||||
if (isDefined(recordAfterPosition) && isDefined(recordBeforePosition)) {
|
if (isDefined(recordAfterPosition) && isDefined(recordBeforePosition)) {
|
||||||
return (recordBeforePosition + recordAfterPosition) / 2;
|
return (recordBeforePosition + recordAfterPosition) / 2;
|
||||||
} else if (isDefined(recordAfterPosition)) {
|
|
||||||
return recordAfterPosition - 1;
|
|
||||||
} else if (isDefined(recordBeforePosition)) {
|
|
||||||
return recordBeforePosition + 1;
|
|
||||||
} else {
|
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isDefined(recordAfterPosition)) {
|
||||||
|
return recordAfterPosition - 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isDefined(recordBeforePosition)) {
|
||||||
|
return recordBeforePosition + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 1;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user