Skip to content

Commit

Permalink
fix: don't trigger move action if source / destination the same
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisvxd committed Nov 2, 2024
1 parent b2ace76 commit 5d273dc
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/core/reducer/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,13 @@ export function reduceData<UserData extends Data>(
}

if (action.type === "move") {
if (
action.sourceZone === action.destinationZone &&
action.sourceIndex === action.destinationIndex
) {
return data;
}

const newData = setupZone(
setupZone(data, action.sourceZone),
action.destinationZone
Expand Down

0 comments on commit 5d273dc

Please sign in to comment.