Skip to content

Commit bcc506b

Browse files
authored
fix(ui): disableListColumn fields not hidden in table columns (#6445)
## Description Setting `disableListColumn` to `true` on a field would hide the field from the column selector but not from the table columns. - [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 3d7c827 commit bcc506b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import type { FieldMap, MappedField } from '../../providers/ComponentMap/buildCo
44
// 2. Maps through top-level `tabs` fields and filters out the same
55
export const filterFields = (fieldMap: FieldMap): FieldMap => {
66
const shouldSkipField = (field: MappedField): boolean =>
7-
field.type !== 'ui' && field.disabled === true
7+
(field.type !== 'ui' && field.disabled === true) || field?.disableListColumn === true
88

99
const fields: FieldMap = fieldMap.reduce((formatted, field) => {
1010
if (shouldSkipField(field)) {

0 commit comments

Comments
 (0)