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 Jan 10, 2025
1 parent 1134e8b commit 8a0b811
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 @@ -162,6 +162,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 8a0b811

Please sign in to comment.