Skip to content

Commit

Permalink
Fix when movin item on top of next item
Browse files Browse the repository at this point in the history
  • Loading branch information
tero-paananen committed Mar 12, 2022
1 parent 35fd003 commit a052526
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/DraggableFlatList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ const CustomDraggableFlatList = ({
toIndex--;
const newData = moveItem(fromIndex, toIndex, dataRef.current);
onHandleMove(fromIndex, toIndex, newData);
} else if (fromIndex > toIndex && fromIndex > toIndex + 1) {
} else if (fromIndex > toIndex) {
// moving item to up
const newData = moveItem(fromIndex, toIndex, dataRef.current);
onHandleMove(fromIndex, toIndex, newData);
Expand Down

0 comments on commit a052526

Please sign in to comment.