Skip to content

Commit

Permalink
fix: move down
Browse files Browse the repository at this point in the history
  • Loading branch information
le-ar committed Jan 17, 2024
1 parent 513ec42 commit cf76236
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/hooks/useDragDropList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,15 @@ export function useDragDropList<T, TComponent extends Component>(
continue;
}

const itemStart = horizontal ? measurement.pageX : measurement.pageY;
const itemLength = horizontal ? measurement.width : measurement.height;
if (isBefore) {
const itemStart = horizontal ? measurement.pageX : measurement.pageY;
const minStart = itemStart + (length + itemLength) / 2;
if (center < minStart) {
return [undefined, handler.id];
}
} else {
const minStart = start + (length + itemLength) / 2;
const minStart = itemStart + itemLength - (length + itemLength) / 2;
if (center < minStart) {
return [undefined, handler.id];
} else {
Expand Down

0 comments on commit cf76236

Please sign in to comment.