Skip to content

Commit

Permalink
[field] Skip unchanged array items with identical from/to index
Browse files Browse the repository at this point in the history
  • Loading branch information
rexxars committed Oct 6, 2020
1 parent 60fe3b2 commit a58aaee
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/@sanity/field/src/diff/changes/buildChangeList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ export function buildArrayChangeList(
titlePath: ChangeTitlePath = []
): ChangeNode[] {
const changedOrMoved = diff.items.filter(
item => item.hasMoved || item.diff.action !== 'unchanged'
item => (item.hasMoved && item.fromIndex !== item.toIndex) || item.diff.action !== 'unchanged'
)

if (changedOrMoved.length === 0) {
Expand Down

0 comments on commit a58aaee

Please sign in to comment.