Skip to content

Commit 9f52562

Browse files
authored
fix(ui): removes array & blocks & group fields from sort (#6576)
## Description V2 PR [here](#6574) - [x] I have read and understand the [CONTRIBUTING.md](https://github.com/payloadcms/payload/blob/main/CONTRIBUTING.md) document in this repository. ## Type of change - [x] Bug fix (non-breaking change which fixes an issue) ## Checklist: - [x] Existing test suite passes locally with my changes
1 parent 7309d47 commit 9f52562

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

packages/ui/src/elements/TableColumns/buildColumnState.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,14 +110,15 @@ export const buildColumnState = (args: Args): Column[] => {
110110
/>
111111
)
112112

113+
const fieldAffectsDataSubFields =
114+
field &&
115+
field.type &&
116+
(field.type === 'array' || field.type === 'group' || field.type === 'blocks')
117+
113118
const Heading = (
114119
<SortColumn
115120
Label={Label}
116-
disable={
117-
('disableSort' in field && Boolean(field.disableSort)) ||
118-
fieldIsPresentationalOnly(field) ||
119-
undefined
120-
}
121+
disable={fieldAffectsDataSubFields || fieldIsPresentationalOnly(field) || undefined}
121122
// eslint-disable-next-line react/jsx-no-duplicate-props
122123
label={
123124
'fieldComponentProps' in field && 'label' in field.fieldComponentProps

0 commit comments

Comments
 (0)