Skip to content

Commit

Permalink
[field] Fix broken title paths on deep ChangeList
Browse files Browse the repository at this point in the history
  • Loading branch information
rexxars committed Oct 6, 2020
1 parent bb93fdc commit ccc63c4
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions packages/@sanity/field/src/diff/components/ChangeList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,10 @@ export function ChangeList({diff, fields, schemaType}: Props): React.ReactElemen
throw new Error(`Only object schema types are allowed in ChangeList`)
}

const allChanges = React.useMemo(() => buildObjectChangeList(schemaType, diff, path, fields), [
schemaType,
fields,
path,
diff
])
const allChanges = React.useMemo(
() => buildObjectChangeList(schemaType, diff, path, [], {fieldFilter: fields}),
[schemaType, fields, path, diff]
)

const changes = fields && fields.length === 0 ? [] : maybeFlatten(allChanges)

Expand Down

0 comments on commit ccc63c4

Please sign in to comment.